diff options
author | fenn <fennetic.net> | 2009-09-10 15:52:33 -0500 |
---|---|---|
committer | fenn <fennetic.net> | 2009-09-10 15:52:33 -0500 |
commit | d99c2c512b1bd9993d278f9c27fa4c2a3f7407b6 (patch) | |
tree | 81766f01777bdfa2292e9b670a2b8ae50539493b /packages | |
parent | d9f43d886951ed2a137a8ad4ab887e555f8407db (diff) | |
download | skdb-d99c2c512b1bd9993d278f9c27fa4c2a3f7407b6.tar.gz skdb-d99c2c512b1bd9993d278f9c27fa4c2a3f7407b6.zip |
another way to fail utterly
Diffstat (limited to 'packages')
-rw-r--r-- | packages/threads/generate.py | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/packages/threads/generate.py b/packages/threads/generate.py index d302f83..d32ae24 100644 --- a/packages/threads/generate.py +++ b/packages/threads/generate.py @@ -1,7 +1,9 @@ from OCC.Geom import * from OCC.Geom2d import * +from OCC.GeomFill import * from OCC.GCE2d import * +from OCC.BRep import * from OCC.BRepLib import * from OCC.BRepBuilderAPI import * from OCC.BRepOffsetAPI import * @@ -11,11 +13,11 @@ import math from gui import display, start_display radius = 1 -turns = 5 +turns = 0.5 cyl = Geom_CylindricalSurface(gp_Ax3(gp_Pnt(0,0,0), gp_Dir(0,0,1)), radius).GetHandle() slope = GCE2d_MakeSegment(gp_Pnt2d(0,0), gp_Pnt2d(turns*2*math.pi, 1)).Operator() -helix = BRepBuilderAPI_MakeEdge(slope, cyl).Edge() -helix = BRepBuilderAPI_MakeWire(helix).Wire() +helix_edge = BRepBuilderAPI_MakeEdge(slope, cyl).Edge() +helix = BRepBuilderAPI_MakeWire(helix_edge).Wire() #what a fucking pain in the ass circle = gp_Circ(gp_Ax2(gp_Pnt(radius,0,0), gp_Dir(0,1,0)), 0.05) @@ -23,14 +25,41 @@ circle_edge = BRepBuilderAPI_MakeEdge(circle).Edge() circle_wire = BRepBuilderAPI_MakeWire(circle_edge).Wire() circle_face = BRepBuilderAPI_MakeFace(circle_wire).Shape() + + +line_edge = BRepBuilderAPI_MakeEdge(gp_Pnt(radius,0,0), gp_Pnt(radius,0,1)).Edge() +line_wire = BRepBuilderAPI_MakeWire(line_edge).Wire() +line_edge = BRepBuilderAPI_MakeEdge(gp_Pnt(radius,0,0), gp_Pnt(radius,0,1)).Shape() + print helix.Closed() print circle_edge.Closed() from OCC.BRepPrimAPI import BRepPrimAPI_MakePrism sweep = BRepPrimAPI_MakePrism(circle_face, gp_Vec(0,1,0)).Shape() #sweep = BRepOffsetAPI_MakePipe(helix, circle_edge).Shape() +#sweep = BRepOffsetAPI_MakePipe(circle_wire, line_edge).Shape() + + +helix_curve = BRep_Tool().Curve(helix_edge)[0] #wtf +circle_curve = BRep_Tool().Curve(circle_edge)[0] +#aPipe2 = GeomFill_Pipe(helix,TC1,TC2, mode) +print type(helix_curve) +aPipe2 = GeomFill_Pipe(helix_curve, circle_curve) +aPipe2.Perform(0,0) +aSurface2= aPipe2.Surface() + +#ps = BRepOffsetAPI_MakePipeShell(helix) +#ps.Add(circle_wire) +#print 'hi' +#ps.SetMode(True) +#display.DisplayShape(ps.Generated(circle_wire).Last()) +#display.DisplayShape(ps.FirstShape()) +#print 'here' +#ps.Build() +#sweep = ps.MakeSolid() display.DisplayShape(helix) -display.DisplayShape(circle_face) -display.DisplayShape(sweep) +#display.DisplayShape(circle_face) +#display.DisplayShape(line_edge) +#display.DisplayShape(sweep) start_display() |