From ee2e7fc3fad920252927e4dc5e35c399063187b0 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 14 Aug 2014 11:38:39 +0200 Subject: [PATCH] + Give example for discretize() matching the shape type --- src/Mod/Part/App/TopoShapeEdgePy.xml | 7 +++---- src/Mod/Part/App/TopoShapeWirePy.xml | 12 ++++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Mod/Part/App/TopoShapeEdgePy.xml b/src/Mod/Part/App/TopoShapeEdgePy.xml index 5e98c29c6..adf51dbb1 100644 --- a/src/Mod/Part/App/TopoShapeEdgePy.xml +++ b/src/Mod/Part/App/TopoShapeEdgePy.xml @@ -90,14 +90,13 @@ then the behaviour is as if using the keyword 'Distance'. Example: import Part -c=Part.Circle() -c.Radius=5 -p=c.discretize(Number=50,First=3.14) +e=Part.makeCircle(5) +p=e.discretize(Number=50,First=3.14) s=Part.Compound([Part.Vertex(i) for i in p]) Part.show(s) -p=c.discretize(Angular=0.09,Curvature=0.01,Last=3.14,Minimum=100) +p=e.discretize(Angular=0.09,Curvature=0.01,Last=3.14,Minimum=100) s=Part.Compound([Part.Vertex(i) for i in p]) Part.show(s) diff --git a/src/Mod/Part/App/TopoShapeWirePy.xml b/src/Mod/Part/App/TopoShapeWirePy.xml index b7695da70..3912462e9 100644 --- a/src/Mod/Part/App/TopoShapeWirePy.xml +++ b/src/Mod/Part/App/TopoShapeWirePy.xml @@ -72,14 +72,18 @@ then the behaviour is as if using the keyword 'Distance'. Example: import Part -c=Part.Circle() -c.Radius=5 -p=c.discretize(Number=50,First=3.14) +V=App.Vector + +e1=Part.makeCircle(5,V(0,0,0),V(0,0,1),0,180) +e2=Part.makeCircle(5,V(10,0,0),V(0,0,1),180,360) +w=Part.Wire([e1,e2]) + +p=w.discretize(Number=50) s=Part.Compound([Part.Vertex(i) for i in p]) Part.show(s) -p=c.discretize(Angular=0.09,Curvature=0.01,Last=3.14,Minimum=100) +p=w.discretize(Angular=0.09,Curvature=0.01,Minimum=100) s=Part.Compound([Part.Vertex(i) for i in p]) Part.show(s)