Draft Shape2DView/ru: Difference between revisions

From FreeCAD Documentation
(Created page with "{{GuiCommand/ru |Name=Draft Shape2DView |Name/ru=Draft Shape2DView |Workbenches=Draft, Arch |MenuLocation=Черчение → 2D вид...")
 
(Updating to match new version of source page)
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
<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}}

<div class="mw-translate-fuzzy">
{{GuiCommand/ru
{{GuiCommand/ru
|Name=Draft Shape2DView
|Name=Draft Shape2DView
Line 5: Line 9:
|MenuLocation=Черчение → 2D вид фигуры
|MenuLocation=Черчение → 2D вид фигуры
}}
}}
</div>


==Description==
==Description==


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.
This tool places in the document a 2D object which is a flattened view of a selected [[Part Module|Shape]]-based object, projected along the current view direction.

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.


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


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


# 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.
# Select the object you want to extract a 2D view from
# Select a 3D object.
# Rotate the view (or use the view presets shortcuts) so it reflects the direction you want to project the object to. For example, using a Top view will project the object on the XY plane, vertically along the Z axis like on the image above.
# Press the {{KEY|[[Image:Draft Shape2DView.png|16px]] [[Draft Shape2DView]]}} button
# 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.

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]].

'''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.


==Options==
==Options==


There are no options for this tool. Either it works with the selected object or not.
* If the selected object is an [[Arch SectionPlane]], the 2D projection will be of the contents of the Section plane, and the projection vector will be taken from the section plane instead of the Projection property below.
* The normal operating mode is '''Solid''', which projects the whole shape, but, if you selected some faces of the base object when creating the 2D view, you can also set the '''Individual Faces''' mode, which will project only the faces that were selected.
* If the selected object is an [[Arch SectionPlane]], a '''cutlines''' projection mode is also available, which projects only the edges being cut by the section plane.


==Properties==
==Properties==


* {{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}}: The direction of the projection.
* {{PropertyData|Projection Mode}}: The mode of the projection: solid, individual faces, or cutlines.
* {{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.


==Scripting==
==Scripting==
{{Emphasis|See also:}} [[Draft API]] and [[FreeCAD Scripting Basics]].


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


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

* Adds a 2D shape to the document, which is a 2D projection of the given object.
* Creates {{incode|Shape2DView}} as a projection of the given {{incode|baseobj}}.
* A specific projection vector can also be given.
** If {{incode|facenumbers}} is given, it is a list of face numbers to be considered for the projection.
* Returns the generated object.
* If a {{incode|projectionVector}} is given, it is used; otherwise the default projection is along the Z axis.
* You can also provide a list of face numbers to be considered.

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"}}.


Example:
Example:


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

Draft.makeShape2DView(FreeCAD.ActiveDocument.ActiveObject)
Box = FreeCAD.ActiveDocument.addObject("Part::Box", "Box")
Box.Length = 2300
Box.Width = 800
Box.Height = 1000

Shape1 = Draft.makeShape2DView(Box)

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

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

FreeCAD.ActiveDocument.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}}
<languages/>

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

Revision as of 21:28, 21 February 2020

Draft Shape2DView

Системное название
Draft Shape2DView
Расположение в меню
Черчение → 2D вид фигуры
Верстаки
Draft, Arch
Быстрые клавиши
Нет
Представлено в версии
-
См. также
Нет

Description

The Draft Shape2DView tool produces a 2D projection from a selected 3D solid object such as those created with the Part, PartDesign, and Arch Workbenches.

The resulting projection is a Draft object and is placed in the 3D view. This object can be displayed on a TechDraw Workbench page, using the TechDraw NewDraft tool. Alternatively, TechDraw has its own tools to create projected views, the File:TechDraw NewView.svg TechDraw NewView and File:TechDraw NewProjGroup.svg 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.

Projection of solid shapes into the XY plane

Usage

  1. 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.
  2. Select a 3D object.
  3. Press the Draft Shape2DView button. If no object is selected, you will be invited to select one.

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.

Note: If the selected object is an Arch SectionPlane, the projection will use the contents and direction of that Section plane; in this case, the "Projection" property will be ignored.

Options

There are no options for this tool. Either it works with the selected object or not.

Properties

  • Данные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.
  • Данные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.
  • ДанныеIn Place: if it is true, together with "Cutlines" or "Cutfaces" modes, the resulting projection will appear co-planar with the Arch SectionPlane. introduced in version 0.17
  • ДанныеHiddenLines: if it is true it will show the hidden lines of the projection.
  • ДанныеTessellation: if it is true it will perform tessellation of ellipses and splines, that is, it will represent curves with very fine line segments.
Note: this may be computationally intensive if ДанныеSegment Length is very small.
  • ДанныеSegment Length: specifies the size in millimeters of linear segments if ДанныеTessellation is true.
Note: set a larger value first, and then change it to a smaller value to get better resolution.
  • ДанныеVisible Only: if it is true the projection will be recomputed only if it is visible.

Scripting

See also: Draft API and FreeCAD Scripting Basics.

The Draft Shape2DView tool can be used in macros and from the Python console by using the following function:

Shape2DView = makeShape2DView(baseobj, projectionVector=None, facenumbers=[])
  • Creates Shape2DView as a projection of the given baseobj.
    • If facenumbers is given, it is a list of face numbers to be considered for the projection.
  • If a projectionVector is given, it is used; otherwise the default projection is along the Z axis.

The ProjectionMode attribute needs to be overwritten with the desired mode, which can be "Solid", "Individual Faces", "Cutlines", or "Cutfaces".

Example:

import FreeCAD, Draft

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

Shape1 = Draft.makeShape2DView(Box)

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

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

FreeCAD.ActiveDocument.recompute()