Draft Shape2DView/ru: Difference between revisions
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
Line 45: | Line 45: | ||
==Properties== |
==Properties== |
||
See also: [[property_editor|Property editor]]. |
|||
* {{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", "Cutfaces" and "Solid faces" ({{Version|0.20}}). |
|||
A Draft Shape2DView object is derived from a [[Part_Part2DObject|Part Part2DObject]] and inherits all its properties. It also has the following additional properties: |
|||
⚫ | |||
** If only some faces of the base object are selected, the "Individual Faces" mode will project only those faces. |
|||
=== Data === |
|||
⚫ | |||
⚫ | |||
{{TitleProperty|Draft}} |
|||
⚫ | |||
* {{PropertyData|In Place}}: if it is {{TRUE}}, together with "Cutlines" or "Cutfaces" modes, the resulting projection will appear co-planar with the [[Arch_SectionPlane|Arch SectionPlane]]. {{Version|0.17}} |
|||
* {{PropertyData| |
* {{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|Tessellation}}: if it is {{TRUE}} it will perform tessellation of ellipses and splines, that is, it will represent curves with very fine line segments. |
|||
* {{PropertyData|Fuse Arch|Bool}}: specifies if [[Arch Workbench|Arch objects]] of the same type and material are fused or not. |
|||
:{{Emphasis|Note:}} this may be computationally intensive if {{PropertyData|Segment Length}} is very small. |
|||
* {{PropertyData| |
* {{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. |
|||
:{{Emphasis|Note:}} set a larger value first, and then change it to a smaller value to get better resolution. |
|||
* {{PropertyData| |
* {{PropertyData|Projection|Vector}}: specifies the direction of the projection. |
||
* {{PropertyData|Projection Mode|Enumeration}}: specifies the projection mode. The following modes are available: |
|||
⚫ | |||
** {{Value|Individual Faces}}: only projects the faces in the {{PropertyData|Face Numbers}} list. |
|||
⚫ | |||
⚫ | |||
⚫ | |||
* {{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}} |
|||
===View=== |
|||
{{TitleProperty|Draft}} |
|||
* {{PropertyView|Pattern|Enumeration}}: not used. |
|||
* {{PropertyView|Pattern Size|Float}}: not used. |
|||
==How to produce plans and sections with different linewidths== |
|||
[[Image:Draft_shape2dview_example_plan.png|800px]] |
|||
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. |
|||
==Scripting== |
==Scripting== |
||
See also: [https:// |
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. |
|||
The Draft Shape2DView tool can be used in [[macros|macros]] and from the [[Python|Python]] console by using the following function: |
|||
{{Code|code= |
{{Code|code= |
||
shape2dview = make_shape2dview(baseobj, projectionVector=None, facenumbers=[]) |
|||
}} |
}} |
||
* |
* {{incode|baseobj}} is the object to be projected. |
||
* {{incode|projectionVector}} is the projection vector. If not supplied the Z axis is used. |
|||
* |
* {{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. |
|||
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"}}. |
|||
Example: |
Example: |
||
{{Code|code= |
{{Code|code= |
||
import FreeCAD |
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() |
|||
}} |
}} |
||
Revision as of 09:54, 1 June 2021
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 DraftView tool. Alternatively, TechDraw has its own tools to create projected views, the TechDraw View and TechDraw ProjectionGroup 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
- 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 a 3D object.
- 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
See also: Property editor.
A Draft Shape2DView object is derived from a Part Part2DObject and inherits all its properties. It also has the following additional properties:
Data
Draft
- ДанныеBase (
Link
): specifies the object to be projected. - ДанныеFace Numbers (
IntegerList
): specifies the indices of the faces to be projected. Only works if ДанныеProjection Mode isIndividual Faces
. - ДанныеFuse Arch (
Bool
): specifies if Arch objects of the same type and material are fused or not. - ДанныеHidden Lines (
Bool
): specifies if hidden lines are shown or not. - ДанныеIn Place (
Bool
): only works if the selected object is an Arch SectionPlane, and ДанныеProjection Mode isCutlines
orCutfaces
, specifies if the projection will appear co-planar with the section plane. - ДанныеProjection (
Vector
): specifies the direction of the projection. - ДанныеProjection 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 ДанныеFace 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 theSolid
mode gives wrong results. introduced in version 0.20
- ДанныеSegment Length (
Float
): specifies the size in millimeters of linear segments if ДанныеTessellation istrue
. - Данные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 ДанныеSegment Length is too short. - ДанныеVisible Only (
Bool
): specifies if the projection should only be recomputed if it is visible. - ДанныеExclusion 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
View
Draft
- ВидPattern (
Enumeration
): not used. - ВидPattern Size (
Float
): not used.
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.
Scripting
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"
.
Example:
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()
- Drafting: Line, Polyline, Fillet, Arc, Arc by 3 points, Circle, Ellipse, Rectangle, Polygon, B-spline, Cubic Bézier curve, Bézier curve, Point, Facebinder, ShapeString, Hatch
- Annotation: Text, Dimension, Label, Annotation styles, Annotation scale
- Modification: Move, Rotate, Scale, Mirror, Offset, Trimex, Stretch, Clone, Array, Polar array, Circular array, Path array, Path link array, Point array, Point link array, Edit, Subelement highlight, Join, Split, Upgrade, Downgrade, Wire to B-spline, Draft to sketch, Set slope, Flip dimension, Shape 2D view
- Draft Tray: Select plane, Set style, Toggle construction mode, AutoGroup
- Snapping: Snap lock, Snap endpoint, Snap midpoint, Snap center, Snap angle, Snap intersection, Snap perpendicular, Snap extension, Snap parallel, Snap special, Snap near, Snap ortho, Snap grid, Snap working plane, Snap dimensions, Toggle grid
- Miscellaneous: Apply current style, Layer, Manage layers, Add a new named group, Move to group, Select group, Add to construction group, Toggle normal/wireframe display, Create working plane proxy, Heal, Show snap toolbar
- Additional: Constraining, Pattern, Preferences, Import Export Preferences, DXF/DWG, SVG, OCA, DAT
- Context menu:
- Layer container: Merge layer duplicates, Add new layer
- Layer: Activate this layer, Select layer contents
- Text: Open hyperlinks
- Wire: Flatten
- Working plane proxy: Write camera position, Write objects state
- Начинающим
- Установка: Загрузка, Windows, Linux, Mac, Дополнительных компонентов, Docker, AppImage, Ubuntu Snap
- Базовая: О FreeCAD, Интерфейс, Навигация мыши, Методы выделения, Имя объекта, Настройки, Верстаки, Структура документа, Свойства, Помоги FreeCAD, Пожертвования
- Помощь: Учебники, Видео учебники
- Верстаки: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework