From 61c6ed0858067c717d8ad1ec853b00466c9e8d81 Mon Sep 17 00:00:00 2001 From: Jeremy Wright Date: Mon, 5 Jan 2015 22:49:21 -0500 Subject: [PATCH] Changed all embedded examples to use Helpers.show() instead of Part.show(). --- CadQuery/Examples/Ex000_Introduction.py | 6 +++--- CadQuery/Examples/Ex001_Simple_Block.py | 6 +++--- .../Examples/Ex002_Block_With_Bored_Center_Hole.py | 6 +++--- .../Ex003_Pillow_Block_With_Counterbored_Holes.py | 6 +++--- .../Examples/Ex004_Extruded_Cylindrical_Plate.py | 6 +++--- CadQuery/Examples/Ex005_Extruded_Lines_and_Arcs.py | 6 +++--- .../Ex006_Moving_the_Current_Working_Point.py | 6 +++--- CadQuery/Examples/Ex007_Using_Point_Lists.py | 6 +++--- CadQuery/Examples/Ex008_Polygon_Creation.py | 6 +++--- CadQuery/Examples/Ex009_Polylines.py | 6 +++--- .../Ex010_Defining_an_Edge_with_a_Spline.py | 6 +++--- .../Examples/Ex011_Mirroring_Symmetric_Geometry.py | 6 +++--- .../Examples/Ex012_Creating_Workplanes_on_Faces.py | 6 +++--- .../Ex013_Locating_a_Workplane_on_a_Vertex.py | 6 +++--- CadQuery/Examples/Ex014_Offset_Workplanes.py | 6 +++--- CadQuery/Examples/Ex015_Rotated_Workplanes.py | 13 ++++++------- .../Examples/Ex016_Using_Construction_Geometry.py | 11 ++++++----- .../Ex017_Shelling_to_Create_Thin_Features.py | 6 +++--- CadQuery/Examples/Ex018_Making_Lofts.py | 10 +++++----- CadQuery/Examples/Ex019_Counter_Sunk_Holes.py | 10 +++++----- .../Examples/Ex020_Rounding_Corners_with_Fillets.py | 6 +++--- CadQuery/Examples/Ex021_Splitting_an_Object.py | 6 +++--- CadQuery/Examples/Ex022_Classic_OCC_Bottle.py | 10 +++++----- CadQuery/Examples/Ex023_Parametric_Enclosure.py | 6 +++--- CadQuery/Examples/Ex025_Revolution.py | 6 +++--- CadQuery/Examples/Ex026_Lego_Brick.py | 5 +++-- CadQuery/Examples/Ex027_Remote_Enclosure.py | 6 +++--- 27 files changed, 93 insertions(+), 92 deletions(-) diff --git a/CadQuery/Examples/Ex000_Introduction.py b/CadQuery/Examples/Ex000_Introduction.py index aa2925c..a11fb7f 100644 --- a/CadQuery/Examples/Ex000_Introduction.py +++ b/CadQuery/Examples/Ex000_Introduction.py @@ -5,7 +5,7 @@ # Ex026_Lego_Brick.py is highly recommended as a great example of what CadQuery # can do. import cadquery -import Part +from Helpers import show # The dimensions of the box. These can be modified rather than changing the # object's code directly. @@ -16,5 +16,5 @@ thickness = 1.0 # Create a 3D box based on the dimension variables above result = cadquery.Workplane("XY").box(length, height, thickness) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex001_Simple_Block.py b/CadQuery/Examples/Ex001_Simple_Block.py index f505fb3..a95b064 100644 --- a/CadQuery/Examples/Ex001_Simple_Block.py +++ b/CadQuery/Examples/Ex001_Simple_Block.py @@ -1,6 +1,6 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # The dimensions of the box. These can be modified rather than changing the # object's code directly. @@ -11,5 +11,5 @@ thickness = 10.0 # Create a 3D box based on the dimension variables above result = cadquery.Workplane("XY").box(length, height, thickness) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex002_Block_With_Bored_Center_Hole.py b/CadQuery/Examples/Ex002_Block_With_Bored_Center_Hole.py index 48b7769..6203204 100644 --- a/CadQuery/Examples/Ex002_Block_With_Bored_Center_Hole.py +++ b/CadQuery/Examples/Ex002_Block_With_Bored_Center_Hole.py @@ -1,6 +1,6 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # The dimensions of the box. These can be modified rather than changing the # object's code directly. @@ -13,5 +13,5 @@ center_hole_dia = 22.0 result = cadquery.Workplane("XY").box(length, height, thickness) \ .faces(">Z").workplane().hole(center_hole_dia) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex003_Pillow_Block_With_Counterbored_Holes.py b/CadQuery/Examples/Ex003_Pillow_Block_With_Counterbored_Holes.py index 9eac730..74c1d84 100644 --- a/CadQuery/Examples/Ex003_Pillow_Block_With_Counterbored_Holes.py +++ b/CadQuery/Examples/Ex003_Pillow_Block_With_Counterbored_Holes.py @@ -1,6 +1,6 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # The dimensions of the box. These can be modified rather than changing the # object's code directly. @@ -19,5 +19,5 @@ result = cadquery.Workplane("XY").box(length, height, thickness) \ .rect(length - 8.0, height - 8.0, forConstruction=True) \ .vertices().cboreHole(cbore_hole_diameter, cbore_diameter, cbore_depth) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex004_Extruded_Cylindrical_Plate.py b/CadQuery/Examples/Ex004_Extruded_Cylindrical_Plate.py index 4bd77ad..0de305a 100644 --- a/CadQuery/Examples/Ex004_Extruded_Cylindrical_Plate.py +++ b/CadQuery/Examples/Ex004_Extruded_Cylindrical_Plate.py @@ -1,6 +1,6 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # The dimensions of the model. These can be modified rather than changing the # object's code directly. @@ -14,5 +14,5 @@ result = cadquery.Workplane("front").circle(circle_radius) \ .rect(rectangle_width, rectangle_length) \ .extrude(thickness) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex005_Extruded_Lines_and_Arcs.py b/CadQuery/Examples/Ex005_Extruded_Lines_and_Arcs.py index 9b7e984..34e3a1b 100644 --- a/CadQuery/Examples/Ex005_Extruded_Lines_and_Arcs.py +++ b/CadQuery/Examples/Ex005_Extruded_Lines_and_Arcs.py @@ -1,6 +1,6 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # The dimensions of the model. These can be modified rather than changing the # object's code directly. @@ -13,5 +13,5 @@ result = cadquery.Workplane("front").lineTo(width, 0) \ .threePointArc((1.0, 1.5), (0.0, 1.0)) \ .close().extrude(thickness) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex006_Moving_the_Current_Working_Point.py b/CadQuery/Examples/Ex006_Moving_the_Current_Working_Point.py index 2a5bef3..fbb463c 100644 --- a/CadQuery/Examples/Ex006_Moving_the_Current_Working_Point.py +++ b/CadQuery/Examples/Ex006_Moving_the_Current_Working_Point.py @@ -1,6 +1,6 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # The dimensions of the model. These can be modified rather than changing the # object's code directly. @@ -18,5 +18,5 @@ result = result.center(-1.5, 1.5).circle(0.25) # New work center is ( 0.0,1.5) result = result.extrude(thickness) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex007_Using_Point_Lists.py b/CadQuery/Examples/Ex007_Using_Point_Lists.py index 5030709..effd879 100644 --- a/CadQuery/Examples/Ex007_Using_Point_Lists.py +++ b/CadQuery/Examples/Ex007_Using_Point_Lists.py @@ -1,6 +1,6 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # The dimensions of the model. These can be modified rather than changing the # object's code directly. @@ -17,5 +17,5 @@ r = r.pushPoints([(1.5, 0), (0, 1.5), (-1.5, 0), (0, -1.5)]) r = r.circle(hole_pattern_radius) result = r.extrude(thickness) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex008_Polygon_Creation.py b/CadQuery/Examples/Ex008_Polygon_Creation.py index 1b5f85e..b3f3469 100644 --- a/CadQuery/Examples/Ex008_Polygon_Creation.py +++ b/CadQuery/Examples/Ex008_Polygon_Creation.py @@ -1,6 +1,6 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # The dimensions of the model. These can be modified rather than changing the # object's code directly. @@ -16,5 +16,5 @@ result = cadquery.Workplane("front").box(width, height, thickness) \ .polygon(polygon_sides, polygon_dia) \ .cutThruAll() -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex009_Polylines.py b/CadQuery/Examples/Ex009_Polylines.py index 2d631dc..2de65be 100644 --- a/CadQuery/Examples/Ex009_Polylines.py +++ b/CadQuery/Examples/Ex009_Polylines.py @@ -1,6 +1,6 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # Set up our Length, Height, Width, and thickness of the beam (L, H, W, t) = (100.0, 20.0, 20.0, 1.0) @@ -21,5 +21,5 @@ pts = [ # I-beam result = cadquery.Workplane("front").polyline(pts).mirrorY().extrude(L) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex010_Defining_an_Edge_with_a_Spline.py b/CadQuery/Examples/Ex010_Defining_an_Edge_with_a_Spline.py index 174cd6f..ad985c5 100644 --- a/CadQuery/Examples/Ex010_Defining_an_Edge_with_a_Spline.py +++ b/CadQuery/Examples/Ex010_Defining_an_Edge_with_a_Spline.py @@ -1,6 +1,6 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # The workplane we want to create the spline on to extrude s = cadquery.Workplane("XY") @@ -22,5 +22,5 @@ r = s.lineTo(3.0, 0).lineTo(3.0, 1.0).spline(sPnts).close() # Extrude to turn the wire into a plate result = r.extrude(0.5) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex011_Mirroring_Symmetric_Geometry.py b/CadQuery/Examples/Ex011_Mirroring_Symmetric_Geometry.py index 0481548..a34a46d 100644 --- a/CadQuery/Examples/Ex011_Mirroring_Symmetric_Geometry.py +++ b/CadQuery/Examples/Ex011_Mirroring_Symmetric_Geometry.py @@ -1,6 +1,6 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # 1.0 is the distance, not coordinate r = cadquery.Workplane("front").hLine(1.0) @@ -11,5 +11,5 @@ r = r.vLine(0.5).hLine(-0.25).vLine(-0.25).hLineTo(0.0) # Mirror the geometry and extrude result = r.mirrorY().extrude(0.25) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex012_Creating_Workplanes_on_Faces.py b/CadQuery/Examples/Ex012_Creating_Workplanes_on_Faces.py index 18c98b1..70ef1da 100644 --- a/CadQuery/Examples/Ex012_Creating_Workplanes_on_Faces.py +++ b/CadQuery/Examples/Ex012_Creating_Workplanes_on_Faces.py @@ -1,6 +1,6 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # Make a basic prism result = cadquery.Workplane("front").box(2, 3, 0.5) @@ -8,5 +8,5 @@ result = cadquery.Workplane("front").box(2, 3, 0.5) # Find the top-most face and make a hole result = result.faces(">Z").workplane().hole(0.5) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex013_Locating_a_Workplane_on_a_Vertex.py b/CadQuery/Examples/Ex013_Locating_a_Workplane_on_a_Vertex.py index 0226ea9..dc7721a 100644 --- a/CadQuery/Examples/Ex013_Locating_a_Workplane_on_a_Vertex.py +++ b/CadQuery/Examples/Ex013_Locating_a_Workplane_on_a_Vertex.py @@ -1,6 +1,6 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # Make a basic prism result = cadquery.Workplane("front").box(3, 2, 0.5) @@ -11,5 +11,5 @@ result = result.faces(">Z").vertices("Z") \ - .workplane() \ - .transformed(offset=Vector(0, -1.5, 1.0), rotate=Vector(60, 0, 0)) \ - .rect(1.5, 1.5, forConstruction=True).vertices().hole(0.25) + .workplane() \ + .transformed(offset=(0, -1.5, 1.0), rotate=(60, 0, 0)) \ + .rect(1.5, 1.5, forConstruction=True).vertices().hole(0.25) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex016_Using_Construction_Geometry.py b/CadQuery/Examples/Ex016_Using_Construction_Geometry.py index 13c8be7..aee8058 100644 --- a/CadQuery/Examples/Ex016_Using_Construction_Geometry.py +++ b/CadQuery/Examples/Ex016_Using_Construction_Geometry.py @@ -1,10 +1,11 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # Create a block with holes in each corner of a rectangle on that workplane -result = cadquery.Workplane("front").box(2, 2, 0.5).faces(">Z").workplane() \ - .rect(1.5, 1.5, forConstruction=True).vertices().hole(0.125) +result = cadquery.Workplane("front").box(2, 2, 0.5)\ + .faces(">Z").workplane() \ + .rect(1.5, 1.5, forConstruction=True).vertices().hole(0.125) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex017_Shelling_to_Create_Thin_Features.py b/CadQuery/Examples/Ex017_Shelling_to_Create_Thin_Features.py index b1aaacd..b984306 100644 --- a/CadQuery/Examples/Ex017_Shelling_to_Create_Thin_Features.py +++ b/CadQuery/Examples/Ex017_Shelling_to_Create_Thin_Features.py @@ -1,9 +1,9 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # Create a hollow box that's open on both ends with a thin wall result = cadquery.Workplane("front").box(2, 2, 2).faces("+Z").shell(0.05) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex018_Making_Lofts.py b/CadQuery/Examples/Ex018_Making_Lofts.py index 7f92d2f..6478f4a 100644 --- a/CadQuery/Examples/Ex018_Making_Lofts.py +++ b/CadQuery/Examples/Ex018_Making_Lofts.py @@ -1,11 +1,11 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # Create a lofted section between a rectangle and a circular section result = cadquery.Workplane("front").box(4.0, 4.0, 0.25).faces(">Z") \ - .circle(1.5).workplane(offset=3.0) \ - .rect(0.75, 0.5).loft(combine=True) + .circle(1.5).workplane(offset=3.0) \ + .rect(0.75, 0.5).loft(combine=True) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex019_Counter_Sunk_Holes.py b/CadQuery/Examples/Ex019_Counter_Sunk_Holes.py index abbbeee..be70587 100644 --- a/CadQuery/Examples/Ex019_Counter_Sunk_Holes.py +++ b/CadQuery/Examples/Ex019_Counter_Sunk_Holes.py @@ -1,11 +1,11 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # Create a plate with 4 counter-sunk holes in it result = cadquery.Workplane(cadquery.Plane.XY()).box(4, 2, 0.5).faces(">Z") \ - .workplane().rect(3.5, 1.5, forConstruction=True)\ - .vertices().cskHole(0.125, 0.25, 82.0, depth=None) + .workplane().rect(3.5, 1.5, forConstruction=True)\ + .vertices().cskHole(0.125, 0.25, 82.0, depth=None) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex020_Rounding_Corners_with_Fillets.py b/CadQuery/Examples/Ex020_Rounding_Corners_with_Fillets.py index 4ce32b5..a2f7876 100644 --- a/CadQuery/Examples/Ex020_Rounding_Corners_with_Fillets.py +++ b/CadQuery/Examples/Ex020_Rounding_Corners_with_Fillets.py @@ -1,9 +1,9 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # Create a plate with 4 rounded corners in the Z-axis result = cadquery.Workplane("XY").box(3, 3, 0.5).edges("|Z").fillet(0.125) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex021_Splitting_an_Object.py b/CadQuery/Examples/Ex021_Splitting_an_Object.py index c778212..6cda407 100644 --- a/CadQuery/Examples/Ex021_Splitting_an_Object.py +++ b/CadQuery/Examples/Ex021_Splitting_an_Object.py @@ -1,6 +1,6 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # Create a simple block with a hole through it that we can split c = cadquery.Workplane("XY").box(1, 1, 1).faces(">Z").workplane() \ @@ -9,5 +9,5 @@ c = cadquery.Workplane("XY").box(1, 1, 1).faces(">Z").workplane() \ # Cut the block in half sideways result = c.faces(">Y").workplane(-0.5).split(keepTop=True) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex022_Classic_OCC_Bottle.py b/CadQuery/Examples/Ex022_Classic_OCC_Bottle.py index b8b2c4d..0721335 100644 --- a/CadQuery/Examples/Ex022_Classic_OCC_Bottle.py +++ b/CadQuery/Examples/Ex022_Classic_OCC_Bottle.py @@ -1,6 +1,6 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # Set up the length, width, and thickness (L, w, t) = (20.0, 6.0, 3.0) @@ -8,8 +8,8 @@ s = cadquery.Workplane("XY") # Draw half the profile of the bottle and extrude it p = s.center(-L / 2.0, 0).vLine(w / 2.0) \ - .threePointArc((L / 2.0, w / 2.0 + t), (L, w / 2.0)).vLine(-w / 2.0) \ - .mirrorX().extrude(30.0, True) + .threePointArc((L / 2.0, w / 2.0 + t), (L, w / 2.0)).vLine(-w / 2.0) \ + .mirrorX().extrude(30.0, True) # Make the neck p.faces(">Z").workplane().circle(3.0).extrude(2.0, True) @@ -17,5 +17,5 @@ p.faces(">Z").workplane().circle(3.0).extrude(2.0, True) # Make a shell result = p.faces(">Z").shell(0.3) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex023_Parametric_Enclosure.py b/CadQuery/Examples/Ex023_Parametric_Enclosure.py index 5e85104..5de638d 100644 --- a/CadQuery/Examples/Ex023_Parametric_Enclosure.py +++ b/CadQuery/Examples/Ex023_Parametric_Enclosure.py @@ -1,6 +1,6 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # Parameter definitions p_outerWidth = 100.0 # Outer width of box enclosure @@ -80,5 +80,5 @@ if p_flipLid: # Return the combined result result = topOfLid.combineSolids(bottom) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex025_Revolution.py b/CadQuery/Examples/Ex025_Revolution.py index 604ccab..da0bb39 100644 --- a/CadQuery/Examples/Ex025_Revolution.py +++ b/CadQuery/Examples/Ex025_Revolution.py @@ -1,6 +1,6 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery -import Part +from Helpers import show # The dimensions of the model. These can be modified rather than changing the # shape's code directly. @@ -19,5 +19,5 @@ result = cadquery.Workplane("XY").rect(rectangle_width, rectangle_length, False) # Revolve a donut with square walls #result = cadquery.Workplane("XY").rect(rectangle_width, rectangle_length, True).revolve(angle_degrees, (20, 0), (20, 10)) -# Boiler plate code to render our solid in FreeCAD's GUI -Part.show(result.toFreecad()) +# Render the solid +show(result) diff --git a/CadQuery/Examples/Ex026_Lego_Brick.py b/CadQuery/Examples/Ex026_Lego_Brick.py index e3227e0..a463a38 100644 --- a/CadQuery/Examples/Ex026_Lego_Brick.py +++ b/CadQuery/Examples/Ex026_Lego_Brick.py @@ -1,7 +1,7 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. # This script can create any regular rectangular Lego(TM) Brick import cadquery -import Part +from Helpers import show ##### # Inputs @@ -52,4 +52,5 @@ elif wbumps > 1: else: tmp = s -Part.show(tmp.toFreecad()) +# Render the solid +show(tmp) diff --git a/CadQuery/Examples/Ex027_Remote_Enclosure.py b/CadQuery/Examples/Ex027_Remote_Enclosure.py index c4ea18c..9f900ae 100644 --- a/CadQuery/Examples/Ex027_Remote_Enclosure.py +++ b/CadQuery/Examples/Ex027_Remote_Enclosure.py @@ -1,6 +1,6 @@ # This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery as cq -import Part +from Helpers import show exploded = False # when true, moves the base away from the top so we see showTop = True # When true, the top is rendered. @@ -84,6 +84,6 @@ cover = (base(coverThickness) # Conditionally render the parts if showTop: - Part.show(top.toFreecad()) + show(top) if showCover: - Part.show(cover.toFreecad()) + show(cover)