diff --git a/CadQuery/Examples/Ex001_Simple_Block.py b/CadQuery/Examples/Ex001_Simple_Block.py index 8e1609c..1ae5fb7 100644 --- a/CadQuery/Examples/Ex001_Simple_Block.py +++ b/CadQuery/Examples/Ex001_Simple_Block.py @@ -1,22 +1,4 @@ -#File: Ex001_Simple_Block.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex001_Simple_Block - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex001_Simple_Block) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more in-depth explanation of this example at http://parametricparts.com/docs/quickstart.html - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex002_Block_With_Bored_Center_Hole.py b/CadQuery/Examples/Ex002_Block_With_Bored_Center_Hole.py index ea405f5..861f7a2 100644 --- a/CadQuery/Examples/Ex002_Block_With_Bored_Center_Hole.py +++ b/CadQuery/Examples/Ex002_Block_With_Bored_Center_Hole.py @@ -1,21 +1,4 @@ -#File: Ex002_Block_With_Bored_Center_Hole.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex002_Block_With_Bored_Center_Hole - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex002_Block_With_Bored_Center_Hole) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more in-depth explantion of this example at http://parametricparts.com/docs/quickstart.html - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex003_Pillow_Block_With_Counterbored_Holes.py b/CadQuery/Examples/Ex003_Pillow_Block_With_Counterbored_Holes.py index 382f03e..73f8362 100644 --- a/CadQuery/Examples/Ex003_Pillow_Block_With_Counterbored_Holes.py +++ b/CadQuery/Examples/Ex003_Pillow_Block_With_Counterbored_Holes.py @@ -1,22 +1,4 @@ -#File: Ex003_Pillow_Block_With_Counterbored_Holes.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex003_Pillow_Block_With_Counterbored_Holes - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex003_Pillow_Block_With_Counterbored_Holes) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more in-depth explanation of this example at http://parametricparts.com/docs/quickstart.html - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex004_Extruded_Cylindrical_Plate.py b/CadQuery/Examples/Ex004_Extruded_Cylindrical_Plate.py index 8b631ce..16643b0 100644 --- a/CadQuery/Examples/Ex004_Extruded_Cylindrical_Plate.py +++ b/CadQuery/Examples/Ex004_Extruded_Cylindrical_Plate.py @@ -1,23 +1,4 @@ -#File: Ex004_Extruded_Cylindrical_Plate.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex004_Extruded_Cylindrical_Plate - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex004_Extruded_Cylindrical_Plate) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex005_Extruded_Lines_and_Arcs.py b/CadQuery/Examples/Ex005_Extruded_Lines_and_Arcs.py index 9994434..80c32ab 100644 --- a/CadQuery/Examples/Ex005_Extruded_Lines_and_Arcs.py +++ b/CadQuery/Examples/Ex005_Extruded_Lines_and_Arcs.py @@ -1,23 +1,4 @@ -#File: Ex005_Extruded_Lines_and_Arcs.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex005_Extruded_Lines_and_Arcs - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex005_Extruded_Lines_and_Arcs) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -#(Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex006_Moving_the_Current_Working_Point.py b/CadQuery/Examples/Ex006_Moving_the_Current_Working_Point.py index 892396c..09608df 100644 --- a/CadQuery/Examples/Ex006_Moving_the_Current_Working_Point.py +++ b/CadQuery/Examples/Ex006_Moving_the_Current_Working_Point.py @@ -1,23 +1,4 @@ -#File: Ex006_Moving_the_Current_Working_Point.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex006_Moving_the_Current_Working_Point - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex006_Moving_the_Current_Working_Point) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex007_Using_Point_Lists.py b/CadQuery/Examples/Ex007_Using_Point_Lists.py index 2609d84..62dd762 100644 --- a/CadQuery/Examples/Ex007_Using_Point_Lists.py +++ b/CadQuery/Examples/Ex007_Using_Point_Lists.py @@ -1,23 +1,4 @@ -#File: Ex007_Using_Point_Lists.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex007_Using_Point_Lists - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex007_Using_Point_Lists) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex008_Polygon_Creation.py b/CadQuery/Examples/Ex008_Polygon_Creation.py index 6eefe13..1486130 100644 --- a/CadQuery/Examples/Ex008_Polygon_Creation.py +++ b/CadQuery/Examples/Ex008_Polygon_Creation.py @@ -1,23 +1,4 @@ -#File: Ex008_Polygon_Creation.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex008_Polygon_Creation - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex008_Polygon_Creation) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex009_Polylines.py b/CadQuery/Examples/Ex009_Polylines.py index 73f9259..6ffb31d 100644 --- a/CadQuery/Examples/Ex009_Polylines.py +++ b/CadQuery/Examples/Ex009_Polylines.py @@ -1,23 +1,4 @@ -#File: Ex009_Polylines.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex009_Polylines - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex009_Polylines) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part 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 7a9534a..ea571a2 100644 --- a/CadQuery/Examples/Ex010_Defining_an_Edge_with_a_Spline.py +++ b/CadQuery/Examples/Ex010_Defining_an_Edge_with_a_Spline.py @@ -1,23 +1,4 @@ -#File: Ex010_Defining_an_Edge_with_a_Spline.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex010_Defining_an_Edge_with_a_Spline - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex010_Defining_an_Edge_with_a_Spline) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex011_Mirroring_Symmetric_Geometry.py b/CadQuery/Examples/Ex011_Mirroring_Symmetric_Geometry.py index 54a02b6..25f16ae 100644 --- a/CadQuery/Examples/Ex011_Mirroring_Symmetric_Geometry.py +++ b/CadQuery/Examples/Ex011_Mirroring_Symmetric_Geometry.py @@ -1,23 +1,4 @@ -#File: Ex011_Mirroring_Symmetric_Geometry.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex011_Mirroring_Symmetric_Geometry - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex011_Mirroring_Symmetric_Geometry) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex012_Creating_Workplanes_on_Faces.py b/CadQuery/Examples/Ex012_Creating_Workplanes_on_Faces.py index 50a8ba3..8fa5a33 100644 --- a/CadQuery/Examples/Ex012_Creating_Workplanes_on_Faces.py +++ b/CadQuery/Examples/Ex012_Creating_Workplanes_on_Faces.py @@ -1,23 +1,4 @@ -#File: Ex012_Creating_Workplanes_on_Faces.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex012_Creating_Workplanes_on_Faces - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex012_Creating_Workplanes_on_Faces) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part 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 a50f74f..6a53145 100644 --- a/CadQuery/Examples/Ex013_Locating_a_Workplane_on_a_Vertex.py +++ b/CadQuery/Examples/Ex013_Locating_a_Workplane_on_a_Vertex.py @@ -1,23 +1,4 @@ -#File: Ex013_Locating_a_Workplane_on_a_Vertex.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex013_Locating_a_Workplane_on_a_Vertex - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex013_Locating_a_Workplane_on_a_Vertex) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex014_Offset_Workplanes.py b/CadQuery/Examples/Ex014_Offset_Workplanes.py index 27ddbfc..6b5f92c 100644 --- a/CadQuery/Examples/Ex014_Offset_Workplanes.py +++ b/CadQuery/Examples/Ex014_Offset_Workplanes.py @@ -1,23 +1,4 @@ -#File: Ex014_Offset_Workplanes.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex014_Offset_Workplanes - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex014_Offset_Workplanes) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex015_Rotated_Workplanes.py b/CadQuery/Examples/Ex015_Rotated_Workplanes.py index 10eef4f..d424176 100644 --- a/CadQuery/Examples/Ex015_Rotated_Workplanes.py +++ b/CadQuery/Examples/Ex015_Rotated_Workplanes.py @@ -1,23 +1,4 @@ -#File: Ex015_Rotated_Workplanes.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex015_Rotated_Workplanes - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex015_Rotated_Workplanes) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery from cadquery import Vector import Part diff --git a/CadQuery/Examples/Ex016_Using_Construction_Geometry.py b/CadQuery/Examples/Ex016_Using_Construction_Geometry.py index 69ba013..3b99684 100644 --- a/CadQuery/Examples/Ex016_Using_Construction_Geometry.py +++ b/CadQuery/Examples/Ex016_Using_Construction_Geometry.py @@ -1,23 +1,4 @@ -#File: Ex016_Using_Construction_Geometry.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex016_Using_Construction_Geometry - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex016_Using_Construction_Geometry) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex017_Shelling_to_Create_Thin_Features.py b/CadQuery/Examples/Ex017_Shelling_to_Create_Thin_Features.py index 7965c44..19a9791 100644 --- a/CadQuery/Examples/Ex017_Shelling_to_Create_Thin_Features.py +++ b/CadQuery/Examples/Ex017_Shelling_to_Create_Thin_Features.py @@ -1,23 +1,4 @@ -#File: Ex017_Shelling_to_Create_Thin_Features.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex017_Shelling_to_Create_Thin_Features - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex017_Shelling_to_Create_Thin_Features) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex018_Making_Lofts.py b/CadQuery/Examples/Ex018_Making_Lofts.py index 847285a..bd79782 100644 --- a/CadQuery/Examples/Ex018_Making_Lofts.py +++ b/CadQuery/Examples/Ex018_Making_Lofts.py @@ -1,23 +1,4 @@ -#File: Ex018_Making_Lofts.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex018_Making_Lofts - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex018_Making_Lofts) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex019_Counter_Sunk_Holes.py b/CadQuery/Examples/Ex019_Counter_Sunk_Holes.py index 4a2590d..df6614d 100644 --- a/CadQuery/Examples/Ex019_Counter_Sunk_Holes.py +++ b/CadQuery/Examples/Ex019_Counter_Sunk_Holes.py @@ -1,23 +1,4 @@ -#File: Ex019_Counter_Sunk_Holes.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex019_Counter_Sunk_Holes - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex019_Counter_Sunk_Holes) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex020_Rounding_Corners_with_Fillets.py b/CadQuery/Examples/Ex020_Rounding_Corners_with_Fillets.py index 2d71322..9d23843 100644 --- a/CadQuery/Examples/Ex020_Rounding_Corners_with_Fillets.py +++ b/CadQuery/Examples/Ex020_Rounding_Corners_with_Fillets.py @@ -1,23 +1,4 @@ -#File: Ex020_Rounding_Corners_with_Fillets.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex020_Rounding_Corners_with_Fillets - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex020_Rounding_Corners_with_Fillets) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex021_Splitting_an_Object.py b/CadQuery/Examples/Ex021_Splitting_an_Object.py index 133104a..2a9b8ba 100644 --- a/CadQuery/Examples/Ex021_Splitting_an_Object.py +++ b/CadQuery/Examples/Ex021_Splitting_an_Object.py @@ -1,23 +1,4 @@ -#File: Ex021_Splitting_an_Object.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex021_Splitting_an_Object - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex021_Splitting_an_Object) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex022_Classic_OCC_Bottle.py b/CadQuery/Examples/Ex022_Classic_OCC_Bottle.py index 8ea52c5..67c5f64 100644 --- a/CadQuery/Examples/Ex022_Classic_OCC_Bottle.py +++ b/CadQuery/Examples/Ex022_Classic_OCC_Bottle.py @@ -1,23 +1,4 @@ -#File: Ex022_Classic_OCC_Bottle.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex022_Classic_OCC_Bottle - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex022_Classic_OCC_Bottle) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex023_Parametric_Enclosure.py b/CadQuery/Examples/Ex023_Parametric_Enclosure.py index ef3308f..a881f21 100644 --- a/CadQuery/Examples/Ex023_Parametric_Enclosure.py +++ b/CadQuery/Examples/Ex023_Parametric_Enclosure.py @@ -1,23 +1,4 @@ -#File: Ex023_Parametric_Enclosure.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex023_Parametric_Enclosure - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex023_Parametric_Enclosure) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Examples/Ex024_Using_FreeCAD_Solids_as_CQ_Objects.py b/CadQuery/Examples/Ex024_Using_FreeCAD_Solids_as_CQ_Objects.py index 7a8088f..6ae69eb 100644 --- a/CadQuery/Examples/Ex024_Using_FreeCAD_Solids_as_CQ_Objects.py +++ b/CadQuery/Examples/Ex024_Using_FreeCAD_Solids_as_CQ_Objects.py @@ -1,23 +1,4 @@ -#File: Ex024_Using_FreeCAD_Solids_as_CQ_Objects.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex024_Using_FreeCAD_Solids_as_CQ_Objects - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex024_Using_FreeCAD_Solids_as_CQ_Objects) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery, FreeCAD, Part #Create a new document that we can draw our model on diff --git a/CadQuery/Examples/Ex025_Revolution.py b/CadQuery/Examples/Ex025_Revolution.py index e0f9364..ad78a8e 100644 --- a/CadQuery/Examples/Ex025_Revolution.py +++ b/CadQuery/Examples/Ex025_Revolution.py @@ -1,23 +1,4 @@ -#File: Ex025_Revolution.py -#To use this example file, you need to first follow the "Using CadQuery From Inside FreeCAD" -#instructions here: https://github.com/dcowden/cadquery#installing----using-cadquery-from-inside-freecad - -#You run this example by typing the following in the FreeCAD python console, making sure to change -#the path to this example, and the name of the example appropriately. -#import sys -#sys.path.append('/home/user/Downloads/cadquery/examples/FreeCAD') -#import Ex025_Revolution - -#If you need to reload the part after making a change, you can use the following lines within the FreeCAD console. -#reload(Ex025_Revolution) - -#You'll need to delete the original shape that was created, and the new shape should be named sequentially -# (Shape001, etc). - -#You can also tie these blocks of code to macros, buttons, and keybindings in FreeCAD for quicker access. -#You can get a more information on this example at -# http://parametricparts.com/docs/examples.html#an-extruded-prismatic-solid - +#This example is meant to be used from within the CadQuery module of FreeCAD. import cadquery import Part diff --git a/CadQuery/Gui/CadQueryGui.py b/CadQuery/Gui/CadQueryGui.py deleted file mode 100644 index 7fc4078..0000000 --- a/CadQuery/Gui/CadQueryGui.py +++ /dev/null @@ -1,3 +0,0 @@ -class CadQueryGui(): - def __workbench__(self): - pass \ No newline at end of file diff --git a/CadQuery/Gui/CadQueryGui.pyc b/CadQuery/Gui/CadQueryGui.pyc deleted file mode 100644 index 4388c32..0000000 Binary files a/CadQuery/Gui/CadQueryGui.pyc and /dev/null differ diff --git a/CadQuery/Gui/Command.py b/CadQuery/Gui/Command.py index 06236ab..e2cdeaa 100644 --- a/CadQuery/Gui/Command.py +++ b/CadQuery/Gui/Command.py @@ -1,3 +1,6 @@ +"""Adds all of the commands that are used for the menus of the CadQuery module""" +# (c) 2014 Jeremy Wright LGPL v3 + import tempfile import FreeCAD, FreeCADGui from PySide import QtGui @@ -34,8 +37,8 @@ class CadQueryCloseScript: #We need this so we can load the file into it cqCodePane = mw.findChild(QtGui.QPlainTextEdit, "cqCodePane") - reply = QtGui.QMessageBox.question(cqCodePane, "QMessageBox.question()", "Save script before closing?", QtGui.QMessageBox.Yes | - QtGui.QMessageBox.No | QtGui.QMessageBox.Cancel) + reply = QtGui.QMessageBox.question(cqCodePane, "QMessageBox.question()", "Save script before closing?", + QtGui.QMessageBox.Yes | QtGui.QMessageBox.No | QtGui.QMessageBox.Cancel) if reply == QtGui.QMessageBox.Cancel: return diff --git a/CadQuery/Gui/ExportCQ.py b/CadQuery/Gui/ExportCQ.py index bc08663..655f51f 100644 --- a/CadQuery/Gui/ExportCQ.py +++ b/CadQuery/Gui/ExportCQ.py @@ -1,3 +1,6 @@ +"""Adds the ability to save a script file to the CadQuery module""" +# (c) 2014 Jeremy Wright LGPL v3 + import FreeCAD, FreeCADGui from PySide import QtGui diff --git a/CadQuery/Gui/ImportCQ.py b/CadQuery/Gui/ImportCQ.py index 86342bc..e74a56d 100644 --- a/CadQuery/Gui/ImportCQ.py +++ b/CadQuery/Gui/ImportCQ.py @@ -1,3 +1,6 @@ +"""Adds the ability to open files from disk to the CadQuery FreeCAD module""" +# (c) 2014 Jeremy Wright LGPL v3 + import os, FreeCAD, FreeCADGui from PySide import QtGui diff --git a/CadQuery/Gui/__init__.py b/CadQuery/Gui/__init__.py index 3df9393..8b13789 100644 --- a/CadQuery/Gui/__init__.py +++ b/CadQuery/Gui/__init__.py @@ -1 +1 @@ -__author__ = 'jwright' + diff --git a/CadQuery/Init.py b/CadQuery/Init.py index c40f1e4..4c40b42 100644 --- a/CadQuery/Init.py +++ b/CadQuery/Init.py @@ -1,2 +1,5 @@ -# FreeCAD init script of the CadQuery module -# (c) 2001 Juergen Riegel LGPL \ No newline at end of file +"""FreeCAD init script of the CadQuery module""" +# (c) 2014 Jeremy Wright LGPL v3 + +#TODO: The FreeCAD devs like to put as much init code as possible in here so that the module can be used without the +#TODO: GUI if desired \ No newline at end of file diff --git a/CadQuery/InitGui.py b/CadQuery/InitGui.py index ce44803..112fb98 100644 --- a/CadQuery/InitGui.py +++ b/CadQuery/InitGui.py @@ -1,11 +1,13 @@ -# CadQuery gui init module -# (c) 2001 Juergen Riegel LGPL +"""CadQuery GUI init module for FreeCAD + This adds a workbench with a scripting editor to FreeCAD's GUI.""" +# (c) 2014 Jeremy Wright LGPL v3 + import FreeCAD import FreeCADGui from Gui.Command import * class CadQueryWorkbench (Workbench): - """CadQuery workbench object""" + """CadQuery workbench for FreeCAD""" MenuText = "CadQuery" ToolTip = "CadQuery workbench" Icon = ":/icons/CQ_Logo.svg" @@ -16,21 +18,31 @@ class CadQueryWorkbench (Workbench): def Initialize(self): import os + #Need to set this for PyQode os.environ['QT_API'] = 'pyside' - import logging - logging.basicConfig(filename='/home/jwright/Downloads/log.txt', level=logging.DEBUG) - #sys.path.append('./Libs/cadquery.zip') - #sys.path.append('./Libs/pyqode.zip') - #If we need a CQ menu, this would be the way to add it + #Turn off logging for now + import logging + logging.basicConfig(filename='C:\Users\Jeremy\Documents\log.txt', level=logging.DEBUG) + + #We have our own CQ menu that's added when the user chooses our workbench commands = ['CadQueryOpenScript', 'CadQuerySaveScript', 'CadQuerySaveAsScript', 'CadQueryExecuteScript', 'CadQueryCloseScript'] self.appendMenu('CadQuery', commands) def Activated(self): + import os, sys + from PySide import QtGui, QtCore + import module_locator + + #Set up so that we can import from our embedded packages + module_base_path = module_locator.module_path() + libs_path = os.path.join(module_base_path, 'Libs') + libs_path = os.path.join(libs_path, 'libs.zip') + sys.path.insert(0, libs_path) + import cadquery - from PySide import QtGui - import sys + from pyqode.python.widgets import PyCodeEdit msg = QtGui.QApplication.translate( "cqCodeWidget", @@ -44,37 +56,6 @@ class CadQueryWorkbench (Workbench): QtGui.QApplication.UnicodeUTF8) FreeCAD.Console.PrintMessage(msg) - from PySide import QtGui - from PySide import QtCore - - FreeCAD.addImportType("CadQuery Script (*.py)", "Gui.ImportCQ") - FreeCAD.addExportType("CadQuery Script (*.py)", "Gui.ExportCQ") - - try: - import cadquery - except ImportError: - msg = QtGui.QApplication.translate( - "cqCodeWidget", - "The cadquery library is not installed, please install it before using this workbench.\r\n" - "Linux and MacOS Users: 'pip install --upgrade cadquery'\r\n" - "Windows Users: 'Not sure yet.\r\n", - None, - QtGui.QApplication.UnicodeUTF8) - FreeCAD.Console.PrintError(msg) - - # import os, sys, inspect - # cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0], "Libs/libraries.zip"))) - # if cmd_subfolder not in sys.path: - # sys.path.append(cmd_subfolder) - import sys - sys.path.insert(0, '/home/jwright/Documents/Projects/CadQuery/cadquery-freecad-module/CadQuery/Libs/libraries.zip') - #sys.path.append('/home/jwright/Documents/Projects/CadQuery/cadquery-freecad-module/CadQuery/Libs/libraries.zip') - - from pyqode.qt import QtWidgets - from pyqode.python.backend import server - from pyqode.python.widgets import PyCodeEdit - from pyqode.python.widgets import code_edit - #Make sure that we enforce a specific version (2.7) of the Python interpreter ver = hex(sys.hexversion) interpreter = "python%s.%s" % (ver[2], ver[4]) # => 'python2.7' @@ -110,14 +91,14 @@ class CadQueryWorkbench (Workbench): mw.addDockWidget(QtCore.Qt.LeftDockWidgetArea, cqCodeWidget) #Set up the text area for our CQ code - codePane = PyCodeEdit(server_script=server.__file__, interpreter=interpreter, args=['-s', '/home/jwright/Documents/Projects/CadQuery/cadquery-freecad-module/CadQuery/Libs/libraries.zip']) + server_path = os.path.join(module_base_path, 'cq_server.py') + codePane = PyCodeEdit(server_script=server_path, interpreter=interpreter, args=['-s', libs_path]) codePane.setObjectName("cqCodePane") #Add the text area to our dock widget cqCodeWidget.setWidget(codePane) def Deactivated(self): - from PySide import QtGui from Gui import ExportCQ #Put the UI back the way we found it diff --git a/CadQuery/Libs/libraries.zip b/CadQuery/Libs/libs.zip similarity index 71% rename from CadQuery/Libs/libraries.zip rename to CadQuery/Libs/libs.zip index 6fb773d..bae959f 100644 Binary files a/CadQuery/Libs/libraries.zip and b/CadQuery/Libs/libs.zip differ diff --git a/CadQuery/Tools/package_libraries.py b/CadQuery/Tools/package_libraries.py index 6e33e0f..138f4ba 100644 --- a/CadQuery/Tools/package_libraries.py +++ b/CadQuery/Tools/package_libraries.py @@ -1,15 +1,42 @@ -from qidle.system import embed_package_into_zip +""" +Test if the zip file is working. -import jedi -import pep8 -import pyqode -import pyqode.core -import pyqode.python -import pyqode.qt -import qidle -import frosted -import pies -import cadquery +Usage: -embed_package_into_zip([jedi, pep8, pyqode.core, pyqode.python, pyqode.qt, qidle, frosted, pies, cadquery], - zip_path='/home/jwright/Documents/Projects/CadQuery/cadquery-freecad-module/CadQuery/Tools/libraries.zip') \ No newline at end of file +- python test_zip_file.py gen +- python test_zip_file.py +""" +import sys +import os +ZIP = os.path.join(os.getcwd(), 'libs.zip') + +if len(sys.argv) == 2 and sys.argv[1] == 'gen': + #--- gen zip file + import jedi, pep8, pyqode, pyqode.core, pyqode.python, pyqode.qt, qidle, frosted, pies, cadquery + from qidle.system import embed_package_into_zip + embed_package_into_zip([jedi, pep8, pyqode, pyqode.core, pyqode.python, + pyqode.qt, cadquery, frosted, pies], ZIP) +else: + # remove all pyqode path from sys.path (to make sure the package are + # imported from the zip archive) + for pth in list(sys.path): + if 'pyqode' in pth: + print('removing %s' % pth) + sys.path.remove(pth) + + # importing a pyqode module should fail + fail = False + try: + from pyqode.core.api import code_edit + except ImportError: + fail = True + assert fail is True + + # mount zip file + sys.path.insert(0, ZIP) + print(sys.path) + + # test it! + from pyqode.core.api import code_edit + print(code_edit.__file__) + assert ZIP in code_edit.__file__ diff --git a/CadQuery/__init__.py b/CadQuery/__init__.py index 3df9393..2dc5183 100644 --- a/CadQuery/__init__.py +++ b/CadQuery/__init__.py @@ -1 +1,6 @@ -__author__ = 'jwright' +__author__ = "Jeremy Wright (jmwright)" +__copyright__ = "Copyright 2014, Innovations Technology Solutions" +__license__ = "LGPL v3" +__version__ = "0.1" +__maintainer__ = "Jeremy Wright" +__status__ = "Beta" diff --git a/CadQuery/cq_server.py b/CadQuery/cq_server.py new file mode 100644 index 0000000..5e35efa --- /dev/null +++ b/CadQuery/cq_server.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Main server script for a pyqode.python backend. You can directly use this +script in your application if it fits your needs or use it as a starting point +for writing your own server. + +:: + + usage: server.py [-h] [-s [SYSPATH [SYSPATH ...]]] port + + positional arguments: + port the local tcp port to use to run the server + + optional arguments: + -h, --help show this help message and exit + -s [SYSPATH [SYSPATH ...]], --syspath [SYSPATH [SYSPATH ...]] + +""" +import argparse +import sys + + +if __name__ == '__main__': + """ + Server process' entry point + """ + # setup argument parser and parse command line args + parser = argparse.ArgumentParser() + parser.add_argument("port", help="the local tcp port to use to run " + "the server") + parser.add_argument('-s', '--syspath', nargs='*') + args = parser.parse_args() + + # add user paths to sys.path + if args.syspath: + for path in args.syspath: + print('append path %s to sys.path\n' % path) + sys.path.append(path) + + from pyqode.core import backend + from pyqode.python.backend.workers import JediCompletionProvider + + # setup completion providers + backend.CodeCompletionWorker.providers.append(JediCompletionProvider()) + backend.CodeCompletionWorker.providers.append( + backend.DocumentWordsProvider()) + + # starts the server + backend.serve_forever(args) diff --git a/CadQuery/module_locator.py b/CadQuery/module_locator.py new file mode 100644 index 0000000..daaf3e2 --- /dev/null +++ b/CadQuery/module_locator.py @@ -0,0 +1,11 @@ +import os, sys + +def we_are_frozen(): + # All of the modules are built-in to the interpreter, e.g., by py2exe + return hasattr(sys, "frozen") + +def module_path(): + encoding = sys.getfilesystemencoding() + if we_are_frozen(): + return os.path.dirname(unicode(sys.executable, encoding)) + return os.path.dirname(unicode(__file__, encoding))