Part Module/es: Difference between revisions

From FreeCAD Documentation
(Created page with "Así, a partir de las formas se pueden crear piezas muy complejas o, al revés, se pueden extraer todas las sub-formas de las que está hecha otra forma más compleja.")
(Redirected.)
Tag: New redirect
 
(237 intermediate revisions by 7 users not shown)
Line 1: Line 1:
#REDIRECT [[Part_Workbench/es]]
Las capacidades CAD de FreeCAD se basan en el núcleo de [http://en.wikipedia.org/wiki/Open_CASCADE OpenCasCade]. El módulo de ''Piezas'' permite a FreeCAD utilizar y acceder a los objetos y funciones de OpenCascade. OpenCascade es un núcleo de CAD de nivel profesional, que cuenta con avanzadas capacidades de manipulación de geometría 3D y objetos. Los objetos ''Pieza'', en contraste con los objetos [[Mesh Module/es| Malla]], son mucho más complejos y, por tanto, permiten operaciones mucho más avanzadas, como operaciones booleanas coherentes, historial de modificaciones y comportamiento paramétrico.

[[Image:Part example.jpg]]

Ejemplo de entidades ''Pieza'' en FreeCAD

=== Las herramientas ===

Las herramientas del módulo ''Pieza'' están todas situadas en el ''menú'' Pieza, que aparece cuando se carga el ''módulo'' Piezas.

{{Part Tools/es}}

=== Operaciones Booleanas ===

[[Image:Part_BooleanOperations.png|500px|left|
An example of union (Fuse), intersection (Common) and difference (Cut)]]

{{clear}}

Un ejemplo de unión (Fusión), intersección (Común) y diferencia (Quita)

=== Explicando conceptos ===

En la terminología OpenCascade, distinguimos entre ''primitivas'' geométricas y ''formas'' (topológicas). Una primitiva ''geométrica'' puede ser un punto, una línea, un círculo, un plano, etc, o incluso algunos tipos más complejos como una superficie o una curva B-Spline. Una ''forma'' puede ser un vértice, un borde, un alambre, una cara, un sólido o un compuesto de otras formas. Las ''primitivas'' geométricas no están hechas para ser visualizadas directamente en la escena 3D, sino que se utilizarán para la construcción de la geometría de las formas. Por ejemplo, un borde (''forma'', shape) puede construirse a partir de una línea o de un arco de círculo (''primitivas'').

Podríamos decir, para resumir, que las ''primitivas'' geométricas son bloques de construcción "inmateriales" (''abstractos, "sin forma"''), y las ''formas'' son la verdadera geometría espacial ("materializada") construida sobre ellas.

Para obtener una lista completa de todos ellos puedes ir a [http://www.opencascade.org/org/doc/ OCC documentation] (Alternativa: [http://opencascade.sourcearchive.com/documentation/6.3.0.dfsg.1-1/classes.html sourcearchive.com]) y búscar '''Geom_*''' (para la geometría) y'''TopoDS_*''' (para las formas). Allí también se puede leer más acerca de las diferencias entre las formas y los objetos geométricos. Ten en cuenta que, lamentablemente, la documentación oficial de OCC no está disponible en línea (se debe descargar un archivo) y está dirigida básicamente a los programadores, no a los usuarios finales. Pero posiblemente puedas encontrar allí información suficiente para iniciarse en esto.

Los tipos geométricos en realidad se puede dividir en dos grandes grupos: las curvas y superficies. A partir de las curvas (líneas, círculos, ...) se puede construir un borde, a partir de las superficies (plano, cilindro, ...) se puede construir una cara. Por ejemplo, la ''primitiva'' geométrica ''línea'' es ilimitada, es decir, se define por un vector de base y un vector de dirección, mientras que su representación como ''forma'' será algo limitado por un punto de inicio y otro de fin. Y, de modo similar, una caja - un sólido - puede ser creada con seis planos limitados.

A partir de un borde o una cara (''formas'') también se puede pasar a su contraparte como ''primitiva'' geométrica.

Así, a partir de las formas se pueden crear piezas muy complejas o, al revés, se pueden extraer todas las sub-formas de las que está hecha otra forma más compleja.

=== Scripting ===

The main data structure used in the Part module is the [http://en.wikipedia.org/wiki/Boundary_representation BRep] data type from OpenCascade.
Almost all contents and object types of the Part module are now available to python scripting. This includes geometric primitives, such as Line and Circle (or Arc), and the whole range of TopoShapes, like Vertexes, Edges, Wires, Faces, Solids and Compounds. For each of those objects, several creation methods exist, and for some of them, especially the TopoShapes, advanced operations like boolean union/difference/intersection are also available. Explore the contents of the Part module, as described in the [[FreeCAD Scripting Basics]] page, to know more.

=== Examples ===

To create a line element switch to the Python console and type in:
<syntaxhighlight>
import Part,PartGui
doc=App.newDocument()
l=Part.Line()
l.StartPoint=(0.0,0.0,0.0)
l.EndPoint=(1.0,1.0,1.0)
doc.addObject("Part::Feature","Line").Shape=l.toShape()
doc.recompute()
</syntaxhighlight>
Let's go through the above python example step by step:
<syntaxhighlight>
import Part,PartGui
doc=App.newDocument()
</syntaxhighlight>
loads the Part module and creates a new document
<syntaxhighlight>
l=Part.Line()
l.StartPoint=(0.0,0.0,0.0)
l.EndPoint=(1.0,1.0,1.0)
</syntaxhighlight>
Line is actually a line segment, hence the start and endpoint.
<syntaxhighlight>
doc.addObject("Part::Feature","Line").Shape=l.toShape()
</syntaxhighlight>
This adds a Part object type to the document and assigns the shape representation of the line segment to the 'Shape' property of the added object. It is important to understand here that we used a geometric primitive (the Part.Line) to create a TopoShape out of it (the toShape() method). Only Shapes can be added to the document. In FreeCAD, geometry primitives are used as "building structures" for Shapes.
<syntaxhighlight>
doc.recompute()
</syntaxhighlight>
Updates the document. This also prepares the visual representation of the new part object.

Note that a Line can be created by specifying its start and endpoint directly in the constructor, for example Part.Line(point1,point2), or we can create a default line and set its properties afterwards, as we did here.

A circle can be created in a similar way:
<syntaxhighlight>
import Part
doc = App.activeDocument()
c = Part.Circle()
c.Radius=10.0
f = doc.addObject("Part::Feature", "Circle")
f.Shape = c.toShape()
doc.recompute()
</syntaxhighlight>
Note again, we used the circle (geometry primitive) to construct a shape out of it. We can of course still access our construction geometry afterwards, by doing:
<syntaxhighlight>
s = f.Shape
e = s.Edges[0]
c = e.Curve
</syntaxhighlight>
Here we take the shape of our object f, then we take its list of edges. In this case there will be only one because we made the whole shape out of a single circle, so we take only the first item of the Edges list, and we takes its curve. Every Edge has a Curve, which is the geometry primitive it is based on.

Head to the [[Topological data scripting]] page if you would like to know more.

{{docnav|Mesh Module|Drawing Module}}

[[Category:User Documentation]]
<languages/>

Latest revision as of 14:54, 27 April 2024

Redirect to: