Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
it would be nice if this worked by monday
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/python | ||
import yaml | ||
import pymates | ||
import settings | ||
|
||
block = pymates.Part(name="block with hole", cadfile="http://adl.serveftp.org/lab/models/blockwithhole.iges") | ||
peg = pymates.Part(name="peg", cadfile="http://adl.serveftp.org/lab/models/peg.iges") | ||
|
||
possibilities = pymates.compatibility(block, peg) | ||
|
||
for each in possibilities: | ||
complex_geom = fuse(block, peg) | ||
volume_diff = pymates.algorithms.calculate_volume_difference(complex_geom) | ||
total_volume = pymates.algorithms.calculate_volume_total(complex_geom) | ||
if settings.mode == 'pythonOCC': #we're in pythonOCC | ||
display.__draw3d__(each) #draw the possibility | ||
elif settings.mode == 'shell': #non-graphical | ||
#assuming it has a nice __repr__ method definition | ||
print each | ||
elif settings.mode == 'web': | ||
#generate svg and cache? | ||
#generate 3D rendering and cache? | ||
pass | ||
pass |