Part TopoShape/de: Difference between revisions

From FreeCAD Documentation
(Created page with "Die topologischen Formen sowie deren Methoden werden durch den OpenCASCADE Technology Kernel (OCCT) definiert. FreeCAD verwendet diese Formen und baut App_DocumentObject/de|...")
(Created page with "{{Caption|Vereinfachtes Diagramm der Beziehungen zwischen den Kernobjekten im Programm. Die Klasse {{incode|Part::TopoShape}} wird in das {{incode|Part::Feature}} Objekt einge...")
Line 9: Line 9:
[[File:FreeCAD_core_objects.svg|800px]]
[[File:FreeCAD_core_objects.svg|800px]]


{{Caption|Simplified diagram of the relationships between the core objects in the program. The {{incode|Part::TopoShape}} class is embedded in the {{incode|Part::Feature}} object and from there it is propagated to all objects that are derived from it.}}
{{Caption|Vereinfachtes Diagramm der Beziehungen zwischen den Kernobjekten im Programm. Die Klasse {{incode|Part::TopoShape}} wird in das {{incode|Part::Feature}} Objekt eingebettet und von dort aus an alle davon abgeleiteten Objekte verbreitet.}}


== How to use ==
== How to use ==

Revision as of 15:17, 17 January 2020

Einleitung

Eine Part TopoForm, oder formal eine Part::TopoShape, ist eine Klasse, die eine parametrische 'topologische Form in der Software definiert. Objekte im Dokument, die etwas in der 3D Ansicht zeigen, haben normalerweise eine TopoForm.

Die topologischen Formen sowie deren Methoden werden durch den OpenCASCADE Technology Kernel (OCCT) definiert. FreeCAD verwendet diese Formen und baut Anwendung DokumentObjekte um sie herum.

Vereinfachtes Diagramm der Beziehungen zwischen den Kernobjekten im Programm. Die Klasse Part::TopoShape wird in das Part::Feature Objekt eingebettet und von dort aus an alle davon abgeleiteten Objekte verbreitet.

How to use

The Part TopoShape is an object that is assigned to some App DocumentObjects.

In particular, the basic object that handles these types of attributes is the Part Feature (Part::Feature class). All objects derived from this class will have access to a Part TopoShape.

Some of the most important objects with Part TopoShape are the following:

Scripting

See also: FreeCAD Scripting Basics, and scripted objects.

All objects derived from Part::Feature will have a Part TopoShape, which is normally accessible from its Shape attribute.

import FreeCAD as App

doc = App.newDocument()
obj = App.ActiveDocument.addObject("Part::Box", "Box")
print(obj.Shape)

A TopoShape has many attributes (variables) and methods that contain information about it, and which allow doing operations with it. These variables and methods can be tested in the Python console.

print(obj.Shape.Area)
print(obj.Shape.BoundBox)
print(obj.Shape.CenterOfMass)
print(obj.Shape.ShapeType)

obj.Shape.check()
obj.Shape.copy()
obj.Shape.exportStep("my_file.step")
obj.Shape.exportStl("my_file.stl")

For a full list of attributes and methods, consult the source documentation, and the Std PythonHelp tool.