Part API

From FreeCAD Documentation
Revision as of 17:31, 25 August 2011 by Splineman (talk | contribs) (Created page with 'El módulo Pieza es la conexión directa entre FreeCAD y el kernel de OpenCasCade. Proporciona principalmente TopoShapes el cual es el principal tipo de obje…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

El módulo Pieza es la conexión directa entre FreeCAD y el kernel de OpenCasCade. Proporciona principalmente TopoShapes el cual es el principal tipo de objeto utilizado por OpenCascade. El módulo de Pieza también contiene una variedad de funciones convenientes para crear y manipular topoShapes. Ejemplo:

import Part
mycube = Part.makeBox(2,2,2)
Part.show(mycube)
__fromPythonOCC__ ( OCC.Object )

Descripción: Método de ayuda para convertir una forma pythonocc en una forma interna

Devuelve: Una forma de Pieza Part.Form



__sortEdges__ ( list of edges )

Descripción: 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

Devuelve: Una lista de aristas



__toPythonOCC__ ( Part.Shape )

Descripción: Método de ayuda para convertir una forma interna a una forma pythonocc

Devuelve: Una forma OCC OCC.Shape



cast_to_shape ( Part.Shape )

Descripción: Vaciado del tipo de forma actual

Devuelve:



export ( list,string )

Descripción: Exportar una lista de objetos en un archivo individual.

Devuelve:



getSortedClusters ( list of edges )

Descripción: Método de ayuda para ordenar y agrupar una variedad de aristas

Devuelve:



insert ( string,string )

Descripción: Insert the file (path given as first argument) into the given document (second argument).

Devuelve:



makeBox ( length,width,height,[pnt,dir] )

Descripción: 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)

Devuelve: the created shape



makeCircle ( radius,[pnt,dir,angle1,angle2] )

Descripción: 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

Devuelve: the created shape



makeCompound ( list )

Descripción: Creates a compound out of a list of shapes.

Devuelve: the created shape



makeCone ( radius1,radius2,height,[pnt,dir,angle] )

Descripción: 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

Devuelve: the created shape



makeCylinder ( radius,height,[pnt,dir,angle] )

Descripción: 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

Devuelve: the created shape



makeHelix ( pitch,height,radius,[angle] )

Descripción: 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

Devuelve: the created shape



makeLine ( (x1,y1,z1),(x2,y2,z2) )

Descripción: Makes a line of two points

Devuelve: the created shape



makeLoft ( )

Descripción: Creates a loft shape.

Devuelve: the created shape



makePlane ( length,width,[pnt,dir] )

Descripción: Makes a plane. By default pnt is Vector(0,0,0) and dir is Vector(0,0,1)

Devuelve: the created shape



makePolygon ( list )

Descripción: Makes a polygon of a list of Vectors

Devuelve: the created shape



makeRevolution ( Curve,[vmin,vmax,angle,pnt,dir] )

Descripción: 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)

Devuelve: the created shape



makeRuledSurface ( Edge or Wire,Edge or Wire )

Descripción: Creates a ruled surface out of two edges or wires. If wires are used then these must have the same number of edges.

Devuelve: the created shape



makeShell ( list )

Descripción: Creates a shell out of a list of faces.

Devuelve: the created shape



makeSolid ( Part.Shape )

Descripción: Creates a solid out of the shells inside a shape.

Devuelve: the created shape



makeSphere ( radius,[pnt, dir, angle1,angle2,angle3] )

Descripción: 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

Devuelve: the created shape



makeTorus ( radius1,radius2,[pnt,dir,angle1,angle2,angle] )

Descripción: 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

Devuelve: the created shape



makeTube ( edge,float )

Descripción: Creates a tube.

Devuelve: the created shape



open ( string )

Descripción: Creates a new document and load the file into the document.

Devuelve:



read ( string )

Descripción: Loads the file and return the shape.

Devuelve: a shape



show ( shape )

Descripción: Adds the shape to the active document or create one if no document exists.

Devuelve:



Traducciones disponibles: