Part Module/de: Difference between revisions

From FreeCAD Documentation
m (correction of the link fr)
(Updating to match new version of source page)
Line 1: Line 1:
Die CAD-Fähigkeiten von FreeCAD basieren auf dem [http://en.wikipedia.org/wiki/Open_CASCADE OpenCasCade] kernel. Das Part-modul erlaubt FreeCAD den Zugriff und die Nutzung von OpenCasCade-Objekten und Funktionen. OpenCascade ist ein professioneller CAD-Kernel, der erweiterte Funktionen zur 3D-Geometrie Manipulation und Objekten bereitstellt. Die Part-Objekte, sind im Gegensatz zu [[Mesh Module/de]] Objekten viel komplexer, und erlauben somit deutlich fortgeschrittenere Operationen, wie kohärent Boolsche Operationen, Änderungs-Historie und Parametrisches Verhalten.
The CAD capabilities of FreeCAD are based on the [http://en.wikipedia.org/wiki/Open_CASCADE OpenCasCade] kernel. The Part module allows FreeCAD to access and use the OpenCasCade objects and functions. OpenCascade is a professional-level CAD kernel, that features advanced 3D geometry manipulation and objects. The Part objects, unlike [[Mesh Module]] objects, are much more complex, and therefore permit much more advanced operations, like coherent boolean operations, modifications history and parametric behaviour.


[[Image:Part example.jpg]]
[[Image:Part example.jpg]]


Beispiel eines Form-Teils in FreeCAD
Example of Part shapes in FreeCAD


=== Die Werkzeuge ===
=== The tools ===


Die Part-Modul-Werkzeuge sind alle im '''Part''' Menü, welches erscheint, wenn Sie das Part-Modul laden.
The Part module tools are all located in the '''Part''' menu that appears when you load the Part module.


{{Part Tools/de}}
{{Part Tools}}


=== Boolsche Operationen ===
=== Boolean Operations ===


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


{{clear}}
{{clear}}


Beispiele zu Vereinigung (Fuse), Teilbereich (Common) und Differenz (Cut)
An example of union (Fuse), intersection (Common) and difference (Cut)


=== Erläuterung der Konzepte ===
=== Explaining the concepts ===


In OpenCasCade terminology, we distinguish between geometric primitives and (topological) shapes. A geometric primitive can be a point, a line, a circle, a plane, etc. or even some more complex types like a B-Spline curve or surface. A shape can be a vertex, an edge, a wire, a face, a solid or a compound of other shapes. The geometric primitives are not made to be directly displayed on the 3D scene, but rather to be used as building geometry for shapes. For example, an edge can be constructed from a line or from a portion of a circle.
In der OpenCasCade Terminologie unterscheiden wir zwischen geometrischen Grundelementen und (topologische) Formen. Eine geometrische Primitive kann ein Punkt, eine Linie, ein Kreis, eine Ebene, etc. sein, oder sogar einige kompliziertere Typen wie eine B-Spline-Kurve oder eine Oberfläche. Eine Form kann eine Ecke, eine Kante, ein Netz, eine Fläche, ein Festkörper oder eine Zusammensetzung anderer Gestalten sein. Die geometrische Primitive sind nicht gemacht, um direkt auf die 3D-Szene dargestellt werden, sondern um als Grund-Geometrie für das erstellen von Formen zu dienen. Zum Beispiel kann eine Kante von einer Linie oder aus einem Teil eines Kreises konstruiert werden.


We could say, to resume, that geometry primitive are "shapeless" building blocks, and shapes are the real spatial geometry built on it.
Wir könnten sagen, um fortzufahren, dass die Geometrie-primitive "formlose" Bausteine sind, und Formen sind die wahren räumlichen Geometrien, die darauf aufbauen.


To get a complete list of all of them refer to the [http://www.opencascade.org/org/doc/ OCC documentation] (Alternative: [http://opencascade.sourcearchive.com/documentation/6.3.0.dfsg.1-1/classes.html sourcearchive.com]) and search for '''Geom_*''' (for geometry) and '''TopoDS_*''' (for shapes). There you can also read more about the differences between geometric objects and shapes. Please note that unfortunately the official OCC documentation is not available online (you must download an archive) and is mostly aimed at programmers, not at end-users. But hopefully you'll find enough information to get started here.
Für eine komplette Liste all dieser, begeben Sie sich bitte auf [http://www.opencascade.org/org/doc/ OCC Dokumentation] und suchen Sie nach Geom_Geometry und TopoDS_Shape. Dort können Sie auch mehr über die Unterschiede zwischen geometrischen Objekten und Formen erfahren. Bitte beachten Sie, dass leider die OCC-Dokumentation nicht online verfügbar ist (Sie müssen ein Archiv herunterladen), und ist größtenteils auf Programmierer, nicht auf Endbenutzer ausgerichtet. Aber hoffentlich finden Sie genügend Informationen, um hier einen besseren Start zu erhalten.


The geometric types actually can be divided into two major groups: curves and surfaces. Out of the curves (line, circle, ...) you can directly build an edge, out of the surfaces (plane, cylinder, ...) a face can be built. For example, the geometric primitive line is unlimited, i.e. it is defined by a base vector and a direction vector while its shape representation must be something limited by a start and end point. And a box -- a solid -- can be created by six limited planes.
Die geometrischen Typen können wirklich in zwei Hauptgruppen geteilt werden: Kurven und Oberflächen. Aus den Kurven (Linie, Kreis...) können Sie direkt eine Kante erzeugen, aus den Oberflächen (Ebene, Zylinder, ...) kann eine Form erzeugt werden.
Zum Beispiel, ist die geometrische primitive Linie unbegrenzt, d. h. sie wird durch einen Grundvektor und einen Richtungsvektor definiert, während ihre Form-Darstellung etwa von einem Start-und Endpunkt begrenzt werden muss. Und eine Box - ein Festkörper - kann durch sechs beschränkte Ebenen geschaffen werden.


From an edge or face you can also go back to its geometric primitive counter part.
Von einer Kante oder Fläche können Sie auch zu ihrem geometrischen primitiven Gegenstück zurückgehen.


Thus, out of shapes you can build very complex parts or, the other way round, extract all sub-shapes a more complex shape is made of.
Also, aus Formen können Sie sehr komplizierte Teile bauen, oder andersherum, extrahieren Sie alle Sub-Formen aus denen eine komplexere Form gemacht wurde.


=== Scripting ===
=== Scripting ===


Die Haupt-Daten-Struktur, die das Part-Modul nutzt, ist der [http://en.wikipedia.org/wiki/Boundary_representation BRep] Daten-Typ von OpenCascade.
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.
Praktisch alle Inhalte und Objekttypen des Part-Moduls sind ab sofort für Python-Skripte verfügbar. Das schließt geometrische primitive, wie Linie und Kreis (oder Kreisbogen), und die ganze Palette von TopoShapes, wie Punkten, Kanten, Netzen, Flächen, Festkörper und Zusammensetzungen ein. Für jedes dieser Objekte gibt es mehrere Entwicklungsmethoden, und für einige von ihnen, besonders der TopoShapes, sind fortgeschrittene Operationen wie Boolsche Vereinigung/Differenz/Kreuzung auch verfügbar. Erkunden Sie die Inhalte des Part-Moduls, wie auf der [[FreeCAD Scripting Grundlagen]]-Seite beschrieben, um mehr zu erfahren.


=== Beispiele ===
=== Examples ===


To create a line element switch to the Python console and type in:
Zum erstellen eines Linienelements aktivieren Sie die Python-Konsole und geben Sie ein:
<syntaxhighlight>
import Part,PartGui
import Part,PartGui
doc=App.newDocument()
doc=App.newDocument()
Line 49: Line 49:
doc.addObject("Part::Feature","Line").Shape=l.toShape()
doc.addObject("Part::Feature","Line").Shape=l.toShape()
doc.recompute()
doc.recompute()
</syntaxhighlight>

Let's go through the above python example step by step:
Lassen Sie uns das obige Python-Beispiel Schritt für Schritt betrachten:
<syntaxhighlight>
import Part,PartGui
import Part,PartGui
doc=App.newDocument()
doc=App.newDocument()
</syntaxhighlight>
lädt die Part-Modul und erstellt ein neues Dokument
loads the Part module and creates a new document
<syntaxhighlight>
l=Part.Line()
l=Part.Line()
l.StartPoint=(0.0,0.0,0.0)
l.StartPoint=(0.0,0.0,0.0)
l.EndPoint=(1.0,1.0,1.0)
l.EndPoint=(1.0,1.0,1.0)
</syntaxhighlight>
Line ist eigentlich eine Strecke, folglich der Anfangs- und Endpunkt.
Line is actually a line segment, hence the start and endpoint.
<syntaxhighlight>
doc.addObject("Part::Feature","Line").Shape=l.toShape()
doc.addObject("Part::Feature","Line").Shape=l.toShape()
</syntaxhighlight>
Das fügt ein Part-Objekt zum Dokument hinzu und weist die Form-Darstellung der Strecke der 'Shape'-Eigenschaft des hinzugekommenen Objekts zu. Es ist wichtig, hier zu verstehen, dass wir einen geometrischen Primitiven (den Part.line) verwendeten, um einen TopoShape daraus (mittels der toShape () Methode) zu schaffen. Nur Formen können zum Dokument hinzugefügt werden. In FreeCAD werden Geometrie-primitive als "Grundstrukturen" für Formen verwendet.
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()
doc.recompute()
</syntaxhighlight>
Aktualisiert das Dokument. Damit auch die visuelle Darstellung des neuen Part-Objekts.
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.
Beachten Sie, dass eine Linie durch Angabe der Anfangs-und Endpunkt direkt im Konstruktor erstellt werden kann, z.Beispiel: Part.Line (point1, Punkt2), oder wir können eine Standard-Linie erstellen und seine Eigenschaften anschiessend festlegen, wie wir es hier gemacht haben.


A circle can be created in a similar way:
Ein Kreis kann in ähnlicher Weise erstellt werden:
<syntaxhighlight>
import Part
import Part
doc = App.activeDocument()
doc = App.activeDocument()
Line 73: Line 82:
f.Shape = c.toShape()
f.Shape = c.toShape()
doc.recompute()
doc.recompute()
</syntaxhighlight>
Bemerken Sie wieder, wir verwendeten den Kreis (primitive Geometrie), um eine Form daraus zu erstellen. Wir können natürlich noch immer auf unsere Ursprungs-Geometrie später zugreifen, und zwar so:
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
s = f.Shape
e = s.Edges[0]
e = s.Edges[0]
c = e.Curve
c = e.Curve
</syntaxhighlight>
Hier nehmen wir die Form unseres Objekts f, dann nehmen wir die Liste der Kanten, in diesem Fall wird es nur eine geben, weil wir die ganze Form aus einem einzelnen Kreis machten, also nehmen wir nur das erste Element der Kanten-Liste, und wir nehmen seinen Verlauf. Jede Kante hat einen Verlauf, welches das Geometrie-primitive ist, worauf der Verlauf basiert ist.
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.

Springen Sie zur [[Topological data scripting]] Seite, falls Sie mehr darüber erfahren möchten.


Head to the [[Topological data scripting]] page if you would like to know more.
{{docnav/de|Der Mesh Arbeitsbereich|Der Zeichnungs-Arbeitsbereich}}


{{docnav|Mesh Module|Drawing Module}}
{{languages/de |{{cn|Part Module/cn}} {{en|Part Module}} {{es|Part Module/es}} {{fr|Part Module/fr}} {{it|Part Module/it}} {{jp|Part Module/jp}} {{pl|Part Module/pl}} {{ru|Part Module/ru}} {{se|Part Module/se}} }}


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

Revision as of 22:52, 29 November 2013

The CAD capabilities of FreeCAD are based on the OpenCasCade kernel. The Part module allows FreeCAD to access and use the OpenCasCade objects and functions. OpenCascade is a professional-level CAD kernel, that features advanced 3D geometry manipulation and objects. The Part objects, unlike Mesh Module objects, are much more complex, and therefore permit much more advanced operations, like coherent boolean operations, modifications history and parametric behaviour.

Example of Part shapes in FreeCAD

The tools

The Part module tools are all located in the Part menu that appears when you load the Part module.

Template:Part Tools

Boolean Operations

An example of union (Fuse), intersection (Common) and difference (Cut)
An example of union (Fuse), intersection (Common) and difference (Cut)

An example of union (Fuse), intersection (Common) and difference (Cut)

Explaining the concepts

In OpenCasCade terminology, we distinguish between geometric primitives and (topological) shapes. A geometric primitive can be a point, a line, a circle, a plane, etc. or even some more complex types like a B-Spline curve or surface. A shape can be a vertex, an edge, a wire, a face, a solid or a compound of other shapes. The geometric primitives are not made to be directly displayed on the 3D scene, but rather to be used as building geometry for shapes. For example, an edge can be constructed from a line or from a portion of a circle.

We could say, to resume, that geometry primitive are "shapeless" building blocks, and shapes are the real spatial geometry built on it.

To get a complete list of all of them refer to the OCC documentation (Alternative: sourcearchive.com) and search for Geom_* (for geometry) and TopoDS_* (for shapes). There you can also read more about the differences between geometric objects and shapes. Please note that unfortunately the official OCC documentation is not available online (you must download an archive) and is mostly aimed at programmers, not at end-users. But hopefully you'll find enough information to get started here.

The geometric types actually can be divided into two major groups: curves and surfaces. Out of the curves (line, circle, ...) you can directly build an edge, out of the surfaces (plane, cylinder, ...) a face can be built. For example, the geometric primitive line is unlimited, i.e. it is defined by a base vector and a direction vector while its shape representation must be something limited by a start and end point. And a box -- a solid -- can be created by six limited planes.

From an edge or face you can also go back to its geometric primitive counter part.

Thus, out of shapes you can build very complex parts or, the other way round, extract all sub-shapes a more complex shape is made of.

Scripting

The main data structure used in the Part module is the 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:

 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()

Let's go through the above python example step by step:

 import Part,PartGui
 doc=App.newDocument()

loads the Part module and creates a new document

 l=Part.Line()
 l.StartPoint=(0.0,0.0,0.0)
 l.EndPoint=(1.0,1.0,1.0)

Line is actually a line segment, hence the start and endpoint.

 doc.addObject("Part::Feature","Line").Shape=l.toShape()

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.

 doc.recompute()

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:

 import Part
 doc = App.activeDocument()
 c = Part.Circle() 
 c.Radius=10.0  
 f = doc.addObject("Part::Feature", "Circle")
 f.Shape = c.toShape()
 doc.recompute()

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:

 s = f.Shape
 e = s.Edges[0]
 c = e.Curve

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.

Mesh Module
Drawing Module