From f20d52ebd97aad00b1bd6485dbc7e903750e720b Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Wed, 8 Oct 2014 11:32:41 -0400 Subject: [PATCH] Got the revolve operation working by preventing the wire(s) from being centered. --- cadquery/freecad_impl/shapes.py | 7 +++---- examples/FreeCAD/Ex025_Revolution.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cadquery/freecad_impl/shapes.py b/cadquery/freecad_impl/shapes.py index 9a10345..cf07d72 100644 --- a/cadquery/freecad_impl/shapes.py +++ b/cadquery/freecad_impl/shapes.py @@ -753,16 +753,15 @@ class Solid(Shape): * there cannot be any intersecting or self-intersecting wires * wires must be listed from outside in * more than one levels of nesting is not supported reliably + * the wire(s) that you're revolving cannot be centered This method will attempt to sort the wires, but there is much work remaining to make this method reliable. """ freeCADWires = [outerWire.wrapped] - #my_shape = FreeCADPart.Shape([FreeCADPart.Line(FreeCAD.Vector(0,0,0),FreeCAD.Vector(0,15,0)),FreeCADPart.Line(FreeCAD.Vector(0,15,0),FreeCAD.Vector(15,15,0)),FreeCADPart.Line(FreeCAD.Vector(15,15,0),FreeCAD.Vector(15,0,0)),FreeCADPart.Line(FreeCAD.Vector(15,0,0),FreeCAD.Vector(0,0,0))]) - #freeCADWires = FreeCADPart.Wire(my_shape.Edges) - # for w in innerWires: - # freeCADWires.append(w.wrapped) + for w in innerWires: + freeCADWires.append(w.wrapped) f = FreeCADPart.Face(freeCADWires) result = f.revolve(FreeCAD.Base.Vector(0,0,0), FreeCAD.Base.Vector(0,1,0), angleDegrees) diff --git a/examples/FreeCAD/Ex025_Revolution.py b/examples/FreeCAD/Ex025_Revolution.py index 06dc046..03815cd 100644 --- a/examples/FreeCAD/Ex025_Revolution.py +++ b/examples/FreeCAD/Ex025_Revolution.py @@ -25,7 +25,7 @@ rectange_length = 15.0 angleDegrees = 360.0 #Extrude a cylindrical plate with a rectangular hole in the middle of it -result = cadquery.Workplane("front").rect(rectangle_width, rectange_length).revolve(angleDegrees) +result = cadquery.Workplane("front").rect(rectangle_width, rectange_length, False).revolve(angleDegrees) #Get a cadquery solid object solid = result.val()