App GeoFeature/de: Difference between revisions

From FreeCAD Documentation
(Created page with "==Anwendung==")
No edit summary
 
(27 intermediate revisions by 2 users not shown)
Line 2: Line 2:
{{TOCright}}
{{TOCright}}


<span id="Introduction"></span>
==Einleitung==
==Einleitung==


[[File:Feature.svg|32px]]
[[File:Feature.svg|32px]]


An [[App_GeoFeature|App GeoFeature]] object, or formally an {{incode|App::GeoFeature}}, is the base class of most objects that will display geometrical elements in the [[3D_view|3D view]] because it includes a {{PropertyData|Placement}} property.
Ein [[App_GeoFeature/de|App-GeoFeature]]-Objekt, oder formal ein {{incode|App::GeoFeature}}, ist die Basisklasse der meisten Objekte, die geometrische Elemente in der [[3D_view/de|3D-Ansicht]] anzeigen, da es eine {{PropertyData/de|Placement}} enthält.


[[File:FreeCAD_core_objects.svg|800px]]
[[File:FreeCAD_core_objects.svg|800px]]


{{Caption|Simplified diagram of the relationships between the core objects in FreeCAD}}
{{Caption|Vereinfachtes Diagramm der Beziehungen zwischen den Kernobjekten in FreeCAD}}


<span id="Usage"></span>
==Anwendung==
==Anwendung==


The [[App_GeoFeature|App GeoFeature]] is an internal object, so it cannot be created from the graphical interface. It is generally not meant to be used directly, rather it can be sub-classed to get a bare-bones object that only has a basic {{PropertyData|Placement}} property to define its position in the [[3D_view|3D view]].
Das [[App_GeoFeature/de|App GeoFeature]] ist ein internes Objekt; es kann daher nicht von der grafischen Oberfläche aus erstellt werden. Es ist generell nicht dafür vorgesehen, direkt eingesetzt zu werden, eher zum Ableiten einer Unterklasse für ein nacktes Objekt, das nur eine grundlegende {{PropertyData/de|Placement}} enthält, die seine Position in der [[3D_view/de|3D-Ansicht]] festlegt.


Einige der wichtigsten abgeleiteten Objekte sind folgende:
Some of the most important derived objects are the following:
* The [[Part_Feature|Part Feature]] class, the parent of most objects with 2D and 3D [[Part_TopoShape|topological shapes]].
* Die Klasse [[Part_Feature/de|Part Feature]] (Part-Formelement), übergeordnete Klasse der meisten Objekte mit 2D- und 3D- [[Part_TopoShape/de|TopoFormen]].
* The [[Mesh_Feature|Mesh Feature]] class, the parent of most objects made from [[Mesh_MeshObject|meshes]], not solids.
* Die Klasse [[Mesh_Feature/de|Mesh Feature]] (Mesh-Formelement), übergeordnete Klasse der meisten von [[Mesh_MeshObject/de|Netzobjekten]] abgeleiteten Objekte; keine Festkörper.
* The [[FEM_Mesh|Fem FemMeshObject]] class, the parent of finite element meshes created with the [[FEM_Workbench|FEM Workbench]].
* Die Klasse [[FEM_Mesh/de|Fem FemMeshObject]] (FEM-Netzobjekt), übergeordnete Klasse der FEM-Netze, die mit dem Arbeitsbereich [[FEM_Workbench/de|FEM]] erstellt wurden.
* Die Klasse [[CAM_Feature/de|CAM Feature]] (CAM-Element), übergeordnete Klasse der Werkzeugbahnen (paths), die mit dem Arbeitsbereich [[CAM_Workbench/de|CAM]] für CNC-Bearbeitungen erstellt wurden.
* The [[Path_Feature|Path Feature]] class, the parent of paths created with the [[Path_Workbench|Path Workbench]] for use in CNC machining.
* The [[App_Part|App Part]] class, which defines [[Std_Part|Std Parts]] that can be used as containers of bodies to perform assemblies.
* Die Klasse [[App_Part/de|App Part]] (App-Part), die [[Std_Part/de|Std-Parts]] definiert, die als Behälter von Körpern eingesetzt werden, um Baugruppen zusammenzustellen.


When creating this object in [[Python|Python]], instead of sub-classing {{incode|App::GeoFeature}}, you should sub-class {{incode|App::GeometryPython}} because the latter includes a default view provider, and {{incode|Proxy}} attributes for the object itself, and its view provider. See [[App_GeoFeature#Scripting|Scripting]].
Wird dieses Objekt mit [[Python/de|Python]] erstellt, sollte anstatt eine Unterklasse von {{incode|App::GeoFeature}} abzuleiten, eine Unterklasse von {{incode|App::GeometryPython}} abgeleitet werden, da letztere einen Standard-Viewprovider enthält sowie {{incode|Proxy}}-Attribute für das Objekt selbst und seinen Viewprovider. Siehe [[App_GeoFeature/de#Skripten|Skripten]].


<span id="Properties_App_GeoFeature"></span>
== Properties App GeoFeature ==
==Eigenschaften eines App-GeoFeature-Objekts==


Siehe [[Property/de|Objekteigenschaften]] für alle Arten von Eigenschaften, die skriptgenerierte Objekte besitzen können.
See [[Property|Property]] for all property types that scripted objects can have.


The [[App_GeoFeature|App GeoFeature]] ({{incode|App::GeoFeature}} class) is derived from the basic [[App_DocumentObject|App DocumentObject]] ({{incode|App::DocumentObject}} class) and inherits all its properties. In addition it has a {{PropertyData|Placement}} property, which controls its position in the [[3D_view|3D view]].
Das Objekt [[App_GeoFeature/de|App GeoFeature]] (Klasse {{incode|App::GeoFeature}}) ist von dem grundlegenden [[App_DocumentObject/de|App DocumentObject]] (Klasse {{incode|App::DocumentObject}}) abgeleitet und erbt alle seine Eigenschaften. Zusätzlich besitzt es eine {{PropertyData/de|Placement}}, die seine Position in der [[3D_view/de|3D-Ansicht]] bestimmt.


<span id="Properties_App_GeometryPython"></span>
== Properties App GeometryPython ==
==Eigenschaften eines App-GeometryPython-Objekts==


Siehe [[Property/de|Objekteigenschaften]] für alle Arten von Eigenschaften, die skriptgenerierte Objekte besitzen können.
See [[Property|Property]] for all property types that scripted objects can have.


The [[App_GeoFeature|App GeometryPython]] ({{incode|App::GeometryPython}} class) is derived from the basic [[App_GeoFeature|App GeoFeature]] ({{incode|App::GeoFeature}} class) and inherits all its properties. It also has several additional properties.
Das Objekt [[App_GeoFeature/de|App GeometryPython]] (Klasse {{incode|App::GeometryPython}}) wird von einem [[App_GeoFeature/de|App GeoFeature]] (Klasse {{incode|App::GeoFeature}}) abgeleitet und erbt alle seine Eigenschaften. Es besitzt einige zusätzliche Eigenschaften.


These are the properties available in the [[Property_editor|property editor]]. Hidden properties can be shown by using the {{MenuCommand|Show all}} command in the context menu of the [[Property_editor|property editor]].
Diese sind die im [[Property_editor/de|Eigenschafteneditor]] vorhandenen Eigenschaften. Ausgeblendete Eigenschaften können mit dem Befehl {{MenuCommand|Alle anzeigen}} im Kontextmenü des [[Property_editor/de|Eigenschafteneditors]] angezeigt werden.


<span id="Data"></span>
=== Data ===
===Daten===


{{TitleProperty|Base}}
{{TitleProperty|Basis}}


* {{PropertyData|Proxy|PythonObject|Hidden}}: a custom class associated with this object.
* {{PropertyData|Proxy|PythonObject|Hidden}}: a custom class associated with this object.
Line 53: Line 58:
* {{PropertyData|Visibility|Bool|Hidden}}: whether to display the object or not.
* {{PropertyData|Visibility|Bool|Hidden}}: whether to display the object or not.


<span id="View"></span>
=== View ===
===Ansicht===


{{TitleProperty|Base}}
{{TitleProperty|Basis}}
* {{PropertyView|Proxy|PythonObject|Hidden}}: a custom [[Viewprovider|viewprovider]] class associated with this object.
* {{PropertyView/de|Proxy|PythonObject|Hidden}}: eine spezielle, mit diesen Objekt vebundene, [[Viewprovider/de|Viewprovider]]-klasse.


{{TitleProperty|Display Options}}
{{TitleProperty|Display Options}}
Line 74: Line 80:
* {{PropertyView|Selection Style|Enumeration}}: see the information in [[App_FeaturePython|App FeaturePython]].
* {{PropertyView|Selection Style|Enumeration}}: see the information in [[App_FeaturePython|App FeaturePython]].


== Scripting ==
<span id="Scripting"></span>
==Skripten==


{{Emphasis|See also:}} [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]] and [[Scripted_objects|scripted objects]].
{{Emphasis|Siehe auch:}} [[FreeCAD_Scripting_Basics/de|FreeCAD Grundlagen Skripten]] und [[Scripted_objects/de|Skriptgenerierte Objekte]].


See [[Part_Feature|Part Feature]] for the general information on adding objects to the document.
Siehe [[Part_Feature/de|Part Formelement]] für allgemeine Informationen zum Hinzufügen von Objekten zu einem Dokument.


A GeoFeature is created with the {{incode|addObject()}} method of the document. If you would like to create an object with a 2D or 3D [[Part_TopoShape|topological shape]], it may be better to create one of the sub-classes specialized for handling shapes, for example [[Part_Feature|Part Feature]] or [[Part_Part2DObject|Part Part2DObject]].
Ein GeoFeature wird mit der Methode {{incode|addObject()}} des Dokuments erstellt. Soll ein Objekt mit einer 2D- oder 3D- [[Part_TopoShape|Topoform]] erstellt werden, ist es vielleicht besser, eine Unterklasse zu erstellen, die auf den Umgang mit Formen spezialisiert ist, z.B. [[Part_Feature/de|Part Fomelement]] oder [[Part_Part2DObject/de|Part Part2DObject]].


{{Code|code=
{{Code|code=
Line 90: Line 97:
}}
}}


For [[Python|Python]] subclassing you should create the {{incode|App::GeometryPython}} object.
Für die Ableitung von [[Python/de|Python]]-Unterklassen sollte das {{incode|App::GeometryPython}}-Objekt erstellt werden.


{{Code|code=
{{Code|code=

Latest revision as of 18:49, 18 April 2024

Einleitung

Ein App-GeoFeature-Objekt, oder formal ein App::GeoFeature, ist die Basisklasse der meisten Objekte, die geometrische Elemente in der 3D-Ansicht anzeigen, da es eine Daten-EigenschaftPlacement enthält.

Vereinfachtes Diagramm der Beziehungen zwischen den Kernobjekten in FreeCAD

Anwendung

Das App GeoFeature ist ein internes Objekt; es kann daher nicht von der grafischen Oberfläche aus erstellt werden. Es ist generell nicht dafür vorgesehen, direkt eingesetzt zu werden, eher zum Ableiten einer Unterklasse für ein nacktes Objekt, das nur eine grundlegende Daten-EigenschaftPlacement enthält, die seine Position in der 3D-Ansicht festlegt.

Einige der wichtigsten abgeleiteten Objekte sind folgende:

  • Die Klasse Part Feature (Part-Formelement), übergeordnete Klasse der meisten Objekte mit 2D- und 3D- TopoFormen.
  • Die Klasse Mesh Feature (Mesh-Formelement), übergeordnete Klasse der meisten von Netzobjekten abgeleiteten Objekte; keine Festkörper.
  • Die Klasse Fem FemMeshObject (FEM-Netzobjekt), übergeordnete Klasse der FEM-Netze, die mit dem Arbeitsbereich FEM erstellt wurden.
  • Die Klasse CAM Feature (CAM-Element), übergeordnete Klasse der Werkzeugbahnen (paths), die mit dem Arbeitsbereich CAM für CNC-Bearbeitungen erstellt wurden.
  • Die Klasse App Part (App-Part), die Std-Parts definiert, die als Behälter von Körpern eingesetzt werden, um Baugruppen zusammenzustellen.

Wird dieses Objekt mit Python erstellt, sollte anstatt eine Unterklasse von App::GeoFeature abzuleiten, eine Unterklasse von App::GeometryPython abgeleitet werden, da letztere einen Standard-Viewprovider enthält sowie Proxy-Attribute für das Objekt selbst und seinen Viewprovider. Siehe Skripten.

Eigenschaften eines App-GeoFeature-Objekts

Siehe Objekteigenschaften für alle Arten von Eigenschaften, die skriptgenerierte Objekte besitzen können.

Das Objekt App GeoFeature (Klasse App::GeoFeature) ist von dem grundlegenden App DocumentObject (Klasse App::DocumentObject) abgeleitet und erbt alle seine Eigenschaften. Zusätzlich besitzt es eine Daten-EigenschaftPlacement, die seine Position in der 3D-Ansicht bestimmt.

Eigenschaften eines App-GeometryPython-Objekts

Siehe Objekteigenschaften für alle Arten von Eigenschaften, die skriptgenerierte Objekte besitzen können.

Das Objekt App GeometryPython (Klasse App::GeometryPython) wird von einem App GeoFeature (Klasse App::GeoFeature) abgeleitet und erbt alle seine Eigenschaften. Es besitzt einige zusätzliche Eigenschaften.

Diese sind die im Eigenschafteneditor vorhandenen Eigenschaften. Ausgeblendete Eigenschaften können mit dem Befehl Alle anzeigen im Kontextmenü des Eigenschafteneditors angezeigt werden.

Daten

Basis

  • Daten (Hidden)Proxy (PythonObject): a custom class associated with this object.
  • DatenPlacement (Placement): the position of the object in the 3D view. The placement is defined by a Base point (vector), and a Rotation (axis and angle). See Placement.
    • DatenAngle: the angle of rotation around the DatenAxis. By default, it is (zero degrees).
    • DatenAxis: the unit vector that defines the axis of rotation for the placement. Each component is a floating point value between 0 and 1. If any value is above 1, the vector is normalized so that the magnitude of the vector is 1. By default, it is the positive Z axis, (0, 0, 1).
    • DatenPosition: a vector with the 3D coordinates of the base point. By default, it is the origin (0, 0, 0).
  • DatenLabel (String): the user editable name of this object, it is an arbitrary UTF8 string.
  • Daten (Hidden)Label2 (String): a longer, user editable description of this object, it is an arbitrary UTF8 string that may include newlines. By default, it is an empty string "".
  • Daten (Hidden)Expression Engine (ExpressionEngine): a list of expressions. By default, it is empty [].
  • Daten (Hidden)Visibility (Bool): whether to display the object or not.

Ansicht

Basis

  • Ansicht-Eigenschaft (versteckt)Proxy (PythonObject): eine spezielle, mit diesen Objekt vebundene, Viewprovider-klasse.

Display Options

  • AnsichtBounding Box (Bool): if it is true, the object will show the bounding box in the 3D view.
  • AnsichtDisplay Mode (Enumeration): see the information in App FeaturePython.
  • AnsichtShow In Tree (Bool): see the information in App FeaturePython.
  • AnsichtVisibility (Bool): see the information in App FeaturePython.

Object Style

  • AnsichtShape Color (Color): a tuple of three floating point RGB values (r,g,b) to define the color of the faces in the 3D view; by default it is (0.8, 0.8, 0.8), which is displayed as [204, 204, 204] on base 255, a light gray .
  • Ansicht (Hidden)Shape Material (Material): an App Material associated with this object. By default it is empty.
  • AnsichtTransparency (Percent): an integer from 0 to 100 that determines the level of transparency of the faces in the 3D view. A value of 100 indicates completely invisible faces; the faces are invisible but they can still be picked as long as AnsichtSelectable is true.

Selection

  • AnsichtOn Top When Selected (Enumeration): see the information in App FeaturePython.
  • AnsichtSelectable (Bool): if it is true, the object can be picked with the pointer in the 3D view. Otherwise, the object cannot be selected until this option is set to true.
  • AnsichtSelection Style (Enumeration): see the information in App FeaturePython.

Skripten

Siehe auch: FreeCAD Grundlagen Skripten und Skriptgenerierte Objekte.

Siehe Part Formelement für allgemeine Informationen zum Hinzufügen von Objekten zu einem Dokument.

Ein GeoFeature wird mit der Methode addObject() des Dokuments erstellt. Soll ein Objekt mit einer 2D- oder 3D- Topoform erstellt werden, ist es vielleicht besser, eine Unterklasse zu erstellen, die auf den Umgang mit Formen spezialisiert ist, z.B. Part Fomelement oder Part Part2DObject.

import FreeCAD as App

doc = App.newDocument()
obj = App.ActiveDocument.addObject("App::GeoFeature", "Name")
obj.Label = "Custom label"

Für die Ableitung von Python-Unterklassen sollte das App::GeometryPython-Objekt erstellt werden.

import FreeCAD as App

doc = App.newDocument()
obj = App.ActiveDocument.addObject("App::GeometryPython", "Name")
obj.Label = "Custom label"