App GeoFeature/pl: Difference between revisions

From FreeCAD Documentation
(Created page with "===Dane===")
(Created page with "{{TitleProperty|Podstawa}}")
Line 46: Line 46:
===Dane===
===Dane===


{{TitleProperty|Base}}
{{TitleProperty|Podstawa}}


* {{PropertyData|Proxy|PythonObject|Hidden}}: a custom class associated with this object.
* {{PropertyData|Proxy|PythonObject|Hidden}}: a custom class associated with this object.

Revision as of 19:37, 15 December 2023

Wprowadzenie

Obiekt App: Cechy geometrii, lub formalnie App::GeoFeature, jest klasą bazową większości obiektów wyświetlających elementy geometryczne w oknie widoku 3D, ponieważ zawiera właściwość DANEUmiejscowienie.

Uproszczony diagram zależności pomiędzy podstawowymi obiektami w programie FreeCAD.

Użycie

App: Cechy geometrii jest obiektem wewnętrznym, więc nie można go utworzyć z poziomu interfejsu graficznego. Zasadniczo nie jest on przeznaczony do bezpośredniego użycia, a raczej może być podklasowany, aby uzyskać obiekt typu bare-bones, który ma tylko podstawową właściwość DANEUmiejscowienie do zdefiniowania jego pozycji w oknie Widoku 3D.

Niektóre z najważniejszych obiektów pochodnych są następujące:

Podczas tworzenia tego obiektu w środowisku Python, zamiast klasy podrzędnej App::GeoFeature, należy utworzyć klasę podrzędną App::GeometryPython, ponieważ ta ostatnia zawiera domyślnego dostawcę widoku oraz atrybuty Proxy dla samego obiektu i jego dostawcy widoku. Zobacz także sekcję tworzenie skryptów.

Właściwości App GeoFeature

Zobacz stronę Właściwości dla wszystkich typów właściwości, które mogą mieć obiekty tworzone skryptami.

The App GeoFeature (App::GeoFeature class) is derived from the basic App DocumentObject (App::DocumentObject class) and inherits all its properties. In addition it has a DANEPlacement property, which controls its position in the 3D view.

Właściwości App GeometryPython

Zobacz stronę Właściwości dla wszystkich typów właściwości, które mogą mieć obiekty tworzone skryptami.

The App GeometryPython (App::GeometryPython class) is derived from the basic App GeoFeature (App::GeoFeature class) and inherits all its properties. It also has several additional properties.

These are the properties available in the property editor. Hidden properties can be shown by using the Show all command in the context menu of the property editor.

Dane

Podstawa

  • DANE (Hidden)Proxy (PythonObject): a custom class associated with this object.
  • DANEPlacement (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.
    • DANEAngle: the angle of rotation around the DANEAxis. By default, it is (zero degrees).
    • DANEAxis: 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).
    • DANEPosition: a vector with the 3D coordinates of the base point. By default, it is the origin (0, 0, 0).
  • DANELabel (String): the user editable name of this object, it is an arbitrary UTF8 string.
  • DANE (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 "".
  • DANE (Hidden)Expression Engine (ExpressionEngine): a list of expressions. By default, it is empty [].
  • DANE (Hidden)Visibility (Bool): whether to display the object or not.

View

Base

  • WIDOK (Hidden)Proxy (PythonObject): a custom viewprovider class associated with this object.

Display Options

  • WIDOKBounding Box (Bool): if it is true, the object will show the bounding box in the 3D view.
  • WIDOKDisplay Mode (Enumeration): see the information in App FeaturePython.
  • WIDOKShow In Tree (Bool): see the information in App FeaturePython.
  • WIDOKVisibility (Bool): see the information in App FeaturePython.

Object Style

  • WIDOKShape 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 .
  • WIDOK (Hidden)Shape Material (Material): an App Material associated with this object. By default it is empty.
  • WIDOKTransparency (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 WIDOKSelectable is true.

Selection

  • WIDOKOn Top When Selected (Enumeration): see the information in App FeaturePython.
  • WIDOKSelectable (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.
  • WIDOKSelection Style (Enumeration): see the information in App FeaturePython.

Tworzenie skryptów

Zobacz również: Podstawy tworzenia skryptów FreeCAD, oraz Obiekty skryptowe.

Ogólne informacje na temat dodawania obiektów do dokumentu można znaleźć na stronie Część: właściwość.

Obiekt Cechy geometrii jest tworzony za pomocą metody addObject() dokumentu. Jeśli chcesz utworzyć obiekt o kształcie 2D lub 3D kształt topologiczny, lepszym rozwiązaniem może być utworzenie jednej z klas podrzędnych wyspecjalizowanych do obsługi kształtów, na przykład Część: Cecha lub Część: Część na obiekt 2D.

import FreeCAD as App

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

Dlatego też, dla klasy podrzędnej Python, powinieneś stworzyć obiekt App::GeometryPython.

import FreeCAD as App

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