Part API: Difference between revisions
(Created page with 'Test page for automatic API documentation <div id="APIcontent">test</div>') |
No edit summary |
||
Line 1: | Line 1: | ||
The Part module is the direct connection between FreeCAD and the OpenCasCade kernel. It provides mainly [[TopoShape_API|TopoShapes]] which is the main object type used by OpenCascade. The Part module also contains a variety of convenience functions to create and manipulate topoShapes. Example: |
|||
Test page for automatic API documentation |
|||
import Part |
|||
<div id="APIcontent">test</div> |
|||
mycube = Part.makeBox(2,2,2) |
|||
Part.show(mycube) |
|||
{{APIFunction|__fromPythonOCC__|OCC.Object|Helper method to convert a pythonocc shape to an internal shape|A Part.Shape}} |
|||
{{APIFunction|__sortEdges__|list of edges|Helper method to sort an unsorted list of edges so that afterwards two adjacent edges share a common vertex|a list of edges}} |
|||
{{APIFunction|__toPythonOCC__|Part.Shape|Helper method to convert an internal shape to pythonocc shape|an OCC.Shape}} |
|||
{{APIFunction|cast_to_shape|Part.Shape|Cast to the actual shape type| }} |
|||
{{APIFunction|export|list,string|Export a list of objects into a single file.| }} |
|||
{{APIFunction|getSortedClusters|list of edges|Helper method to sort and cluster a variety of edges| }} |
|||
{{APIFunction|insert|string,string|Insert the file (path given as first argument) into the given document (second argument).| }} |
|||
{{APIFunction|makeBox|length,width,height,[pnt,dir]|Makes a box located at pnt with the dimensions (length,width,height). By default pnt is Vector(0,0,0) and dir is Vector(0,0,1)|the created shape}} |
|||
{{APIFunction|makeCircle|radius,[pnt,dir,angle1,angle2]|Makes a circle with a given radius. By default pnt is Vector(0,0,0), dir is Vector(0,0,1), angle1 is 0 and angle2 is 360|the created shape}} |
|||
{{APIFunction|makeCompound|list|Creates a compound out of a list of shapes.|the created shape}} |
|||
{{APIFunction|makeCone|radius1,radius2,height,[pnt,dir,angle]|Makes a cone with given radii and height. By default pnt is Vector(0,0,0), dir is Vector(0,0,1) and angle is 360|the created shape}} |
|||
{{APIFunction|makeCylinder|radius,height,[pnt,dir,angle]|Makes a cylinder with a given radius and height. By default pnt is Vector(0,0,0),dir is Vector(0,0,1) and angle is 360|the created shape}} |
|||
{{APIFunction|makeHelix|pitch,height,radius,[angle]|Makes a helix with a given pitch, height and radius. By default a cylindrical surface is used to create the helix. If the fourth parameter is set a conical surface is used instead|the created shape}} |
|||
{{APIFunction|makeLine|(x1,y1,z1),(x2,y2,z2)|Makes a line of two points|the created shape}} |
|||
{{APIFunction|makeLoft| |Creates a loft shape.|the created shape}} |
|||
{{APIFunction|makePlane|length,width,[pnt,dir]|Makes a plane. By default pnt is Vector(0,0,0) and dir is Vector(0,0,1)|the created shape}} |
|||
{{APIFunction|makePolygon|list|Makes a polygon of a list of Vectors|the created shape}} |
|||
{{APIFunction|makeRevolution|Curve,[vmin,vmax,angle,pnt,dir]|Makes a revolved shape by rotating the curve or a portion of it around an axis given by (pnt,dir). By default vmin/vmax are set to bounds of the curve,angle is 360,pnt is Vector(0,0,0) and dir is Vector(0,0,1)|the created shape}} |
|||
{{APIFunction|makeRuledSurface|Edge or Wire,Edge or Wire|Creates a ruled surface out of two edges or wires. If wires are used then these must have the same number of edges.|the created shape}} |
|||
{{APIFunction|makeShell|list|Creates a shell out of a list of faces.|the created shape}} |
|||
{{APIFunction|makeSolid|Part.Shape|Creates a solid out of the shells inside a shape.|the created shape}} |
|||
{{APIFunction|makeSphere|radius,[pnt, dir, angle1,angle2,angle3]|Makes a sphere with a given radius. By default pnt is Vector(0,0,0), dir is Vector(0,0,1), angle1 is 0, angle2 is 90 and angle3 is 360|the created shape}} |
|||
{{APIFunction|makeTorus|radius1,radius2,[pnt,dir,angle1,angle2,angle]|Makes a torus with a given radii and angles. By default pnt is Vector(0,0,0),dir is Vector(0,0,1),angle1 is 0,angle1 is 360 and angle is 360|the created shape}} |
|||
{{APIFunction|makeTube|edge,float|Creates a tube.|the created shape}} |
|||
{{APIFunction|open|string|Creates a new document and load the file into the document.| }} |
|||
{{APIFunction|read|string|Loads the file and return the shape.|a shape}} |
|||
{{APIFunction|show|shape|Adds the shape to the active document or create one if no document exists.| }} |
|||
[[Category:API]] |
Revision as of 22:00, 17 August 2010
The Part module is the direct connection between FreeCAD and the OpenCasCade kernel. It provides mainly TopoShapes which is the main object type used by OpenCascade. The Part module also contains a variety of convenience functions to create and manipulate topoShapes. Example:
import Part mycube = Part.makeBox(2,2,2) Part.show(mycube)
Description: Helper method to convert a pythonocc shape to an internal shape
Returns: A Part.Shape
Description: Helper method to sort an unsorted list of edges so that afterwards two adjacent edges share a common vertex
Returns: a list of edges
Description: Helper method to convert an internal shape to pythonocc shape
Returns: an OCC.Shape
Description: Helper method to sort and cluster a variety of edges
Returns:
Description: Insert the file (path given as first argument) into the given document (second argument).
Returns:
Description: Makes a box located at pnt with the dimensions (length,width,height). By default pnt is Vector(0,0,0) and dir is Vector(0,0,1)
Returns: the created shape
Description: Makes a circle with a given radius. By default pnt is Vector(0,0,0), dir is Vector(0,0,1), angle1 is 0 and angle2 is 360
Returns: the created shape
Description: Creates a compound out of a list of shapes.
Returns: the created shape
Description: Makes a cone with given radii and height. By default pnt is Vector(0,0,0), dir is Vector(0,0,1) and angle is 360
Returns: the created shape
Description: Makes a cylinder with a given radius and height. By default pnt is Vector(0,0,0),dir is Vector(0,0,1) and angle is 360
Returns: the created shape
Description: Makes a helix with a given pitch, height and radius. By default a cylindrical surface is used to create the helix. If the fourth parameter is set a conical surface is used instead
Returns: the created shape
Description: Makes a plane. By default pnt is Vector(0,0,0) and dir is Vector(0,0,1)
Returns: the created shape
Description: Makes a revolved shape by rotating the curve or a portion of it around an axis given by (pnt,dir). By default vmin/vmax are set to bounds of the curve,angle is 360,pnt is Vector(0,0,0) and dir is Vector(0,0,1)
Returns: the created shape
Description: Creates a ruled surface out of two edges or wires. If wires are used then these must have the same number of edges.
Returns: the created shape
Description: Creates a solid out of the shells inside a shape.
Returns: the created shape
Description: Makes a sphere with a given radius. By default pnt is Vector(0,0,0), dir is Vector(0,0,1), angle1 is 0, angle2 is 90 and angle3 is 360
Returns: the created shape
Description: Makes a torus with a given radii and angles. By default pnt is Vector(0,0,0),dir is Vector(0,0,1),angle1 is 0,angle1 is 360 and angle is 360
Returns: the created shape