Draft Shape2DView/de: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
 
(26 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages/>
<languages/>

{{Docnav|[[Draft_DelPoint|Delete point]]|[[Draft_Draft2Sketch|Draft to Sketch]]|[[Draft_Module|Draft]]|IconL=Draft_DelPoint.svg|IconC=Workbench_Draft.svg|IconR=Draft_Draft2Sketch.svg}}
{{Docnav
|[[Draft_FlipDimension|FlipDimension]]
|[[Draft_SelectPlane|SelectPlane]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_FlipDimension.svg
|IconR=Draft_SelectPlane.svg
|IconC=Workbench_Draft.svg
}}


{{GuiCommand/de
{{GuiCommand/de
|Name=Draft Shape2DView|Name/de=Form in 2D Ansicht
|Name=Draft Shape2DView
|Name/de=Draft Form2DAnsicht
|MenuLocation=Draft → Form in 2D Ansicht
|MenuLocation=Änderung → Form in 2D Ansicht
|Workbenches=[[Draft Module/de|Draft]], [[Arch Module/de|Arch]]
|Workbenches=[[Draft_Workbench/de|Draft]], [[Arch_Workbench/de|Arch]]
|SeeAlso=[[Part Workbench/de|Part-Arbeitsbereich]], [[TechDraw Workbench/de|TechDraw-Arbeitsbereich]]
|SeeAlso=[[TechDraw_ProjectShape/de|TechDraw FormProjizieren]]
}}
}}


==Description==
<span id="Description"></span>
==Beschreibung==


Der Befehl [[Image:Draft_Shape2DView.svg|24px]] '''Draft Form2DAnsicht''' erstellt 2D-Projektionen von ausgewählten Objekten, in der Regel 3D-Festkörper oder [[Arch_SectionPlane/de|Arch Schnittebenen]]. Die Projektionen werden in der [[3D_view/de|3D-Ansicht]] dargestellt.
The {{Button|[[Image:Draft Shape2DView.svg|16px]] [[Draft Shape2DView|Draft Shape2DView]]}} tool produces a 2D projection from a selected 3D solid object such as those created with the {{KEY|[[Image:Workbench_Part.svg|16px]] [[Part Workbench|Part]]}}, {{KEY|[[Image:Workbench_PartDesign.svg|16px]][[PartDesign Workbench|PartDesign]]}}, and {{KEY|[[Image:Workbench_Arch.svg|16px]] [[Arch Workbench|Arch]]}} Workbenches.


The resulting projection is a Draft object and is placed in the 3D view. This object can be displayed on a {{Button|[[Image:Workbench_TechDraw.svg|16px]] [[TechDraw Workbench|TechDraw]]}} Workbench page, using the [[TechDraw NewDraft]] tool. Alternatively, TechDraw has its own tools to create projected views, the {{Button|[[Image:TechDraw_NewView.svg|16px]] [[TechDraw NewView]]}} and {{Button|[[Image:TechDraw_NewProjGroup.svg|16px]] [[TechDraw NewProjGroup|TechDraw NewProjGroup]]}} tools; however, these tools are meant for preparing technical drawings, so they create the views only in the drawing page, and not in the 3D view.
Draft Shape2DView projections can be displayed on a [[TechDraw_Workbench|TechDraw Workbench]] page using the [[TechDraw_DraftView|TechDraw DraftView]] command. Alternatively the [[TechDraw_Workbench|TechDraw Workbench]] offer its own projection commands. But these create projections that are only displayed on the drawing page and not in the [[3D_view|3D view]].


[[Image:Draft_Shape2DView_example.jpg]]
[[Image:Draft_Shape2DView_example.jpg]]
{{Caption|Projection of solid shapes into the XY plane}}
{{Caption|Projection of solid shapes onto the XY plane}}


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


# Rotate the view so it reflects the direction of the desired projection. For example, a top view will project the object on the XY plane.
# Optionally rotate the [[3D_view|3D view]]. The camera direction in the [[3D_view|3D view]] determines the projection vector. For example, a [[Std_ViewTop|top view]] will project onto the XY plane. The projection vector is ignored for projections created from [[Arch_SectionPlane|Arch SectionPlanes]].
# Optionally select one or more objects.
# Select a 3D object.
# There are several ways to invoke the command:
# Press the {{Button|[[Image:Draft Shape2DView.svg|16px]] [[Draft Shape2DView|Draft Shape2DView]]}} button. If no object is selected, you will be invited to select one.
#* Press the {{Button|[[Image:Draft_Shape2DView.svg|16px]] [[Draft_Shape2DView|Shape 2D view]]}} button.
#* Select the {{MenuCommand|Modification → [[Image:Draft_Shape2DView.svg|16px]] Shape 2D view}} option from the menu.
# If you have not yet selected an object: select an object in the [[3D_view|3D view]].
# The projected objects are created on the XY plane.


==How to produce plans and sections with different linewidths==
The projected object will be created below the selected object, lying on the XY plane. It's position can be changed by changing its properties. The projection direction can also be changed after creation with the [[property editor]].


[[Image:Draft_shape2dview_example_plan.png|700px]]
'''Note:''' If the selected object is an {{Button|[[Image:Arch SectionPlane.svg|16px]] [[Arch SectionPlane|Arch SectionPlane]]}}, the projection will use the contents and direction of that Section plane; in this case, the "Projection" property will be ignored.


Drawings with different linewidths for viewed and cut lines can easily be produced by using two shape2Dview objects from a same [[Arch_SectionPlane|Arch SectionPlane]]. One of the shape2Dview objects has its projection mode set to '''Solid''', which renders the viewed lines, and another set to '''Cut lines''' or '''Cut faces''' to render the cut lines. The two shape2Dviews are then placed at the same location, one on top of the other.
==Options==


<span id="Properties"></span>
There are no options for this tool. Either it works with the selected object or not.
==Eigenschaften==


Siehe auch: [[Property_editor/de|Eigenschafteneditor]].
==Properties==


Ein Draft Shape2DView-Objekt wird von einem [[Part_Part2DObject/de|Part Part2DObject]] abgeleitet und erbt alle seine Eigenschaften. Außerdem hat es die folgenden zusätzlichen Eigenschaften:
* {{PropertyData|Projection}}: specifies the direction of the projection as a vector. For example, (0,0,1) is a projection looking through the Z axis, which would be projected on the XY plane; (1,0,0) is a projection looking through the X axis, which would be projected on the YZ plane; (0,1,0) is a projection looking through the Y axis, which would be projected on the XZ plane. The values can also be negative, in which case the direction of projection is inverted.
* {{PropertyData|Projection Mode}}: it can be "Solid", "Individual Faces", "Cutlines", and "Cutfaces".
** The default projection is "Solid", which projects the entire selected shape.
** If only some faces of the base object are selected, the "Individual Faces" mode will project only those faces.
** If the selected object is an [[Arch SectionPlane]], the "Cutlines" mode will project only the edges being cut by the section plane.
** If the selected object is an [[Arch SectionPlane]], the "Cutfaces" mode will display the cut areas of solids as faces.
* {{PropertyData|In Place}}: if it is {{TRUE}}, together with "Cutlines" or "Cutfaces" modes, the resulting projection will appear co-planar with the [[Arch SectionPlane]]. {{Version|0.17}}
* {{PropertyData|HiddenLines}}: if it is {{TRUE}} it will show the hidden lines of the projection.
* {{PropertyData|Tessellation}}: if it is {{TRUE}} it will perform tessellation of ellipses and splines, that is, it will represent curves with very fine line segments.
:{{Emphasis|Note:}} this may be computationally intensive if {{PropertyData|Segment Length}} is very small.
* {{PropertyData|Segment Length}}: specifies the size in millimeters of linear segments if {{PropertyData|Tessellation}} is {{TRUE}}.
:{{Emphasis|Note:}} set a larger value first, and then change it to a smaller value to get better resolution.
* {{PropertyData|Visible Only}}: if it is {{TRUE}} the projection will be recomputed only if it is visible.


<span id="Data"></span>
==Scripting==
===Daten===
{{Emphasis|See also:}} [[Draft API]] and [[FreeCAD Scripting Basics]].


{{TitleProperty|Draft}}
The Draft Shape2DView tool can be used in [[macros]] and from the [[Python]] console by using the following function:

* {{PropertyData|Auto Update|Bool}}: specifies if the projection should be automatically recomputed if the {{PropertyData|Base}} object changes. Selecting {{False}} can be useful if there are many Draft Shape2DViews in a document or if they are complex. If set to {{False}} the [[Std_Refresh|Std Refresh]] command must be used to update the projection. {{Version|0.20}}
* {{PropertyData|Base|Link}}: specifies the object to be projected.
* {{PropertyData|Face Numbers|IntegerList}}: specifies the indices of the faces to be projected. Only works if {{PropertyData|Projection Mode}} is {{Value|Individual Faces}}.
* {{PropertyData|Fuse Arch|Bool}}: specifies if [[Arch Workbench|Arch objects]] of the same type and material are fused or not.
* {{PropertyData|Hidden Lines|Bool}}: specifies if hidden lines are shown or not.
* {{PropertyData|In Place|Bool}}: only works if the selected object is an [[Arch_SectionPlane|Arch SectionPlane]], and {{PropertyData|Projection Mode}} is {{Value|Cutlines}} or {{Value|Cutfaces}}, specifies if the projection will appear co-planar with the section plane.
* {{PropertyData|Projection|Vector}}: specifies the direction of the projection. Ignored if {{PropertyData|Base}} is an [[Arch_SectionPlane|Arch SectionPlane]].
* {{PropertyData|Projection Mode|Enumeration}}: specifies the projection mode. The following modes are available:
** {{Value|Solid}}: projects the entire selected object.
** {{Value|Individual Faces}}: only projects the faces in the {{PropertyData|Face Numbers}} list.
** {{Value|Cutlines}}: only works if the selected object is an [[Arch_SectionPlane|Arch SectionPlane]], projects only the edges cut by the section plane.
** {{Value|Cutfaces}}: only works if the selected object is an [[Arch_SectionPlane|Arch SectionPlane]], projects the areas cut through solids by the section plane as faces.
** {{Value|Solid faces}}: projects the entire selected object by cutting faces one by one. Can be used if the {{Value|Solid}} mode gives wrong results. {{Version|0.20}}
* {{PropertyData|Segment Length|Float}}: specifies the size in millimeters of linear segments if {{PropertyData|Tessellation}} is {{TRUE}}.
* {{PropertyData|Tessellation|Bool}}: specifies if tessellation should be performed. Tessellation means that curves are replaced by sequences of line segments. This can be computationally intensive if the {{PropertyData|Segment Length}} is too short.
* {{PropertyData|Visible Only|Bool}}: specifies if the projection should only be recomputed if it is visible.
* {{PropertyData|Exclusion Points|Vector list}}: A list of exclusion points. Any edge passing through any of those points will not be drawn. {{Version|0.20}}
* {{PropertyData|Exclusion Names|String list}}: A list of object names. Any viewed or cut child object with a name in that list will not be drawn. {{Version|0.21}}

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

{{TitleProperty|Draft}}

* {{PropertyView|Pattern|Enumeration}}: nicht verwendet.
* {{PropertyView|Pattern Size|Float}}: nicht verwendet.

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

See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].

To create a 2D projection use the {{incode|make_shape2dview}} method ({{Version|0.19}}) of the Draft module. This method replaces the deprecated {{incode|makeShape2DView}} method.


{{Code|code=
{{Code|code=
Shape2DView = makeShape2DView(baseobj, projectionVector=None, facenumbers=[])
shape2dview = make_shape2dview(baseobj, projectionVector=None, facenumbers=[])
}}
}}


* Creates {{incode|Shape2DView}} as a projection of the given {{incode|baseobj}}.
* {{incode|baseobj}} is the object to be projected.
** If {{incode|facenumbers}} is given, it is a list of face numbers to be considered for the projection.
* {{incode|projectionVector}} is the projection vector. If not supplied the Z axis is used.
* If a {{incode|projectionVector}} is given, it is used; otherwise the default projection is along the Z axis.
* {{incode|facenumbers}} is a list of face numbers (0-based). If supplied only these faces are considered.
* {{incode|shape2dview}} is returned with the created 2D projection.


The {{incode|ProjectionMode}} attribute needs to be overwritten with the desired mode, which can be {{incode|"Solid"}}, {{incode|"Individual Faces"}}, {{incode|"Cutlines"}}, or {{incode|"Cutfaces"}}.
Change the {{incode|ProjectionMode}} property of the created object if required. It can be: {{incode|"Solid"}}, {{incode|"Individual Faces"}}, {{incode|"Cutlines"}}, {{incode|"Cutfaces"}} or {{incode|"Solid faces"}}.


Beispiel:
Example:


{{Code|code=
{{Code|code=
import FreeCAD, Draft
import FreeCAD as App
import Draft


doc = App.newDocument()
Box = FreeCAD.ActiveDocument.addObject("Part::Box", "Box")
Box.Length = 2300
Box.Width = 800
Box.Height = 1000


box = doc.addObject("Part::Box", "Box")
Shape1 = Draft.makeShape2DView(Box)
box.Length = 2300
box.Width = 500
box.Height = 1000


shape1 = Draft.make_shape2dview(box)
Shape2 = Draft.makeShape2DView(Box, FreeCAD.Vector(1, -1, 1))


Shape3 = Draft.makeShape2DView(Box, FreeCAD.Vector(-1, 1, 1), [4,5])
shape2 = Draft.make_shape2dview(box, App.Vector(1, -1, 1))
Shape3.ProjectionMode = "Individual Faces"


shape3 = Draft.make_shape2dview(box, App.Vector(-1, 1, 1), [0, 5])
FreeCAD.ActiveDocument.recompute()
shape3.ProjectionMode = "Individual Faces"

doc.recompute()
}}
}}



{{Docnav|[[Draft_DelPoint|Delete point]]|[[Draft_Draft2Sketch|Draft to Sketch]]|[[Draft_Module|Draft]]|IconL=Draft_DelPoint.svg|IconC=Workbench_Draft.svg|IconR=Draft_Draft2Sketch.svg}}
{{Docnav
|[[Draft_FlipDimension|FlipDimension]]
|[[Draft_SelectPlane|SelectPlane]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_FlipDimension.svg
|IconR=Draft_SelectPlane.svg
|IconC=Workbench_Draft.svg
}}


{{Draft Tools navi{{#translation:}}}}
{{Draft Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Latest revision as of 19:55, 7 December 2023

Draft Form2DAnsicht

Menüeintrag
Änderung → Form in 2D Ansicht
Arbeitsbereich
Draft, Arch
Standardtastenkürzel
Keiner
Eingeführt in Version
-
Siehe auch
TechDraw FormProjizieren

Beschreibung

Der Befehl Draft Form2DAnsicht erstellt 2D-Projektionen von ausgewählten Objekten, in der Regel 3D-Festkörper oder Arch Schnittebenen. Die Projektionen werden in der 3D-Ansicht dargestellt.

Draft Shape2DView projections can be displayed on a TechDraw Workbench page using the TechDraw DraftView command. Alternatively the TechDraw Workbench offer its own projection commands. But these create projections that are only displayed on the drawing page and not in the 3D view.

Projection of solid shapes onto the XY plane

Anwendung

  1. Optionally rotate the 3D view. The camera direction in the 3D view determines the projection vector. For example, a top view will project onto the XY plane. The projection vector is ignored for projections created from Arch SectionPlanes.
  2. Optionally select one or more objects.
  3. There are several ways to invoke the command:
    • Press the Shape 2D view button.
    • Select the Modification → Shape 2D view option from the menu.
  4. If you have not yet selected an object: select an object in the 3D view.
  5. The projected objects are created on the XY plane.

How to produce plans and sections with different linewidths

Drawings with different linewidths for viewed and cut lines can easily be produced by using two shape2Dview objects from a same Arch SectionPlane. One of the shape2Dview objects has its projection mode set to Solid, which renders the viewed lines, and another set to Cut lines or Cut faces to render the cut lines. The two shape2Dviews are then placed at the same location, one on top of the other.

Eigenschaften

Siehe auch: Eigenschafteneditor.

Ein Draft Shape2DView-Objekt wird von einem Part Part2DObject abgeleitet und erbt alle seine Eigenschaften. Außerdem hat es die folgenden zusätzlichen Eigenschaften:

Daten

Draft

  • DatenAuto Update (Bool): specifies if the projection should be automatically recomputed if the DatenBase object changes. Selecting false can be useful if there are many Draft Shape2DViews in a document or if they are complex. If set to false the Std Refresh command must be used to update the projection. introduced in version 0.20
  • DatenBase (Link): specifies the object to be projected.
  • DatenFace Numbers (IntegerList): specifies the indices of the faces to be projected. Only works if DatenProjection Mode is Individual Faces.
  • DatenFuse Arch (Bool): specifies if Arch objects of the same type and material are fused or not.
  • DatenHidden Lines (Bool): specifies if hidden lines are shown or not.
  • DatenIn Place (Bool): only works if the selected object is an Arch SectionPlane, and DatenProjection Mode is Cutlines or Cutfaces, specifies if the projection will appear co-planar with the section plane.
  • DatenProjection (Vector): specifies the direction of the projection. Ignored if DatenBase is an Arch SectionPlane.
  • DatenProjection Mode (Enumeration): specifies the projection mode. The following modes are available:
    • Solid: projects the entire selected object.
    • Individual Faces: only projects the faces in the DatenFace Numbers list.
    • Cutlines: only works if the selected object is an Arch SectionPlane, projects only the edges cut by the section plane.
    • Cutfaces: only works if the selected object is an Arch SectionPlane, projects the areas cut through solids by the section plane as faces.
    • Solid faces: projects the entire selected object by cutting faces one by one. Can be used if the Solid mode gives wrong results. introduced in version 0.20
  • DatenSegment Length (Float): specifies the size in millimeters of linear segments if DatenTessellation is true.
  • DatenTessellation (Bool): specifies if tessellation should be performed. Tessellation means that curves are replaced by sequences of line segments. This can be computationally intensive if the DatenSegment Length is too short.
  • DatenVisible Only (Bool): specifies if the projection should only be recomputed if it is visible.
  • DatenExclusion Points (Vector list): A list of exclusion points. Any edge passing through any of those points will not be drawn. introduced in version 0.20
  • DatenExclusion Names (String list): A list of object names. Any viewed or cut child object with a name in that list will not be drawn. introduced in version 0.21

Ansicht

Draft

  • AnsichtPattern (Enumeration): nicht verwendet.
  • AnsichtPattern Size (Float): nicht verwendet.

Skripten

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

To create a 2D projection use the make_shape2dview method (introduced in version 0.19) of the Draft module. This method replaces the deprecated makeShape2DView method.

shape2dview = make_shape2dview(baseobj, projectionVector=None, facenumbers=[])
  • baseobj is the object to be projected.
  • projectionVector is the projection vector. If not supplied the Z axis is used.
  • facenumbers is a list of face numbers (0-based). If supplied only these faces are considered.
  • shape2dview is returned with the created 2D projection.

Change the ProjectionMode property of the created object if required. It can be: "Solid", "Individual Faces", "Cutlines", "Cutfaces" or "Solid faces".

Beispiel:

import FreeCAD as App
import Draft

doc = App.newDocument()

box = doc.addObject("Part::Box", "Box")
box.Length = 2300
box.Width = 500
box.Height = 1000

shape1 = Draft.make_shape2dview(box)

shape2 = Draft.make_shape2dview(box, App.Vector(1, -1, 1))

shape3 = Draft.make_shape2dview(box, App.Vector(-1, 1, 1), [0, 5])
shape3.ProjectionMode = "Individual Faces"

doc.recompute()