Part API/es: Difference between revisions
m (upgrade "makeLoft") |
(Updating to match new version of source page) |
||
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: |
|||
<syntaxhighlight> |
|||
import Part |
import Part |
||
mycube = Part.makeBox(2,2,2) |
mycube = Part.makeBox(2,2,2) |
||
Part.show(mycube) |
Part.show(mycube) |
||
</syntaxhighlight> |
|||
{{APIFunction/es|__fromPythonOCC__|OCC.Object|Método de ayuda para convertir una forma pythonocc en una forma interna|Una forma de Pieza Part.Form}} |
|||
{{APIFunction/es|__sortEdges__|list of edges|Método de ayuda para ordenar y desordenar listas de aristas para que después dos aristas adyacentes compartan un vértice en común|Una lista de aristas}} |
|||
{{APIFunction/es|__toPythonOCC__|Part.Shape|Método de ayuda para convertir una forma interna a una forma pythonocc|Una forma OCC OCC.Shape}} |
|||
⚫ | |||
⚫ | |||
⚫ | |||
{{APIFunction/es|insert|string,string|Inserta el archivo (cuya ruta es dada como primer argumento) en el documento indicado (como segundo argumento).| }} |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
{{APIFunction/es|makeHelix|pitch,height,radius,[angle]|Crea una hélice con un paso, altura y radio dados. Por defecto se utiliza una superficie cilindrica para crear la hélice. Si el cuarto parámetro está definido se utiliza en su lugar una superficie cónica|La forma creada}} |
|||
⚫ | |||
{{APIFunction/es|makeLoft| shapelist<profiles>,[boolean<solid>,boolean<ruled>]|Crea una forma recubrimiento (Loft).|La forma creada}} |
|||
⚫ | |||
⚫ | |||
⚫ | {{APIFunction |
||
{{APIFunction/es|makeRuledSurface|Edge or Wire,Edge or Wire|Crea una superficie reglada a partir de dos aristas o contornos. Si se utilizan contornos estos deben tener el mismo número de aristas.|La forma creada}} |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
{{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|insert|string,string|Insert the file (path given as first argument) into the given document (second argument).| }} |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
{{APIFunction|makeHelix|pitch,height,radius,[angle,lefthand,heightstyle]|Makes a helix shape with a given pitch, height and radius. Defaults to right-handed cylindrical helix. Non-zero angle parameter produces a conical helix. Lefthand True produces left handed helix. Heightstyle applies only to conical helices. Heightstyle False (default) will cause the height parameter to be interpreted as the length of the side of the underlying frustum. Heightstyle True will cause the height parameter to be interpreted as the vertical height of the helix. Pitch is "metric pitch" (advance/revolution). For conical helix, radius is the minor radius.|the created shape}} |
|||
⚫ | |||
{{APIFunction|makeLoft|shapelist<profiles>,[boolean<solid>,boolean<ruled>]|Creates a loft shape using the list of profiles. Optionally make result a solid (vs surface/shell) or make result a ruled surface.|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|show|shape|Adds the shape to the active document or create one if no document exists.| }} |
|||
{{APIFunction/es|show|shape|Añade la forma al documento activo o crea uno si el documento no existe.| }} |
|||
⚫ | |||
{{languages/es| {{en|Part_API}} {{fr|Part_API/fr}} }} |
|||
{{clear}} |
|||
⚫ | |||
<languages/> |
Revision as of 21:47, 5 December 2014
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 shape with a given pitch, height and radius. Defaults to right-handed cylindrical helix. Non-zero angle parameter produces a conical helix. Lefthand True produces left handed helix. Heightstyle applies only to conical helices. Heightstyle False (default) will cause the height parameter to be interpreted as the length of the side of the underlying frustum. Heightstyle True will cause the height parameter to be interpreted as the vertical height of the helix. Pitch is "metric pitch" (advance/revolution). For conical helix, radius is the minor radius.
Returns: the created shape
Description: Creates a loft shape using the list of profiles. Optionally make result a solid (vs surface/shell) or make result a ruled surface.
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,angle2 is 360 and angle is 360
Returns: the created shape