Draft Shape2DView/tr: Difference between revisions
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
(26 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
<languages/> |
|||
{{GuiCommand/tr|Name=Draft Shape2DView|Name/tr=Draft Shape2DView|Workbenches=[[Draft Module/tr|Draft]], [[Arch Module/tr|Arch]]|MenuLocation=Draft -> Shape 2D View}} |
|||
{{Docnav |
|||
|[[Draft_FlipDimension|FlipDimension]] |
|||
|[[Draft_SelectPlane|SelectPlane]] |
|||
|[[Draft_Workbench|Draft]] |
|||
|IconL=Draft_FlipDimension.svg |
|||
|IconR=Draft_SelectPlane.svg |
|||
|IconC=Workbench_Draft.svg |
|||
}} |
|||
<div class="mw-translate-fuzzy"> |
|||
{{GuiCommand/tr |
|||
|Name=Draft Shape2DView |
|||
|Name/tr=2D görünüme çevir |
|||
|MenuLocation=Draft → Shape 2D View |
|||
|Workbenches=[[Draft_Workbench/tr|Draft]], [[Arch_Workbench/tr|Arch]] |
|||
}} |
|||
</div> |
|||
==Description== |
==Description== |
||
The [[Image:Draft_Shape2DView.svg|24px]] '''Draft Shape2DView''' command creates 2D projections from selected objects, usually 3D solids or [[Arch_SectionPlane|Arch SectionPlanes]]. The projections are placed in the [[3D_view|3D view]]. |
|||
This tool places in the document a 2D object which is a flattened view of a selected [[Part Module|Shape]]-based object. |
|||
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 onto the XY plane}} |
|||
== |
==Usage== |
||
# 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]]. |
|||
# Select the object you want to extract a 2D view from |
|||
# Optionally select one or more objects. |
|||
# Press the {{KEY|[[Image:Draft Shape2DView.png|16px]] [[Draft Shape2DView]]}} button |
|||
# There are several ways to invoke the command: |
|||
#* 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== |
|||
==Options== |
|||
[[Image:Draft_shape2dview_example_plan.png|700px]] |
|||
* 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. |
|||
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. |
|||
* 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== |
||
See also: [[Property_editor|Property editor]]. |
|||
* {{PropertyData|Projection}}: The direction of the projection. |
|||
* {{PropertyData|Projection Mode}}: The mode of the projection: solid, individual faces, or cutlines. |
|||
A Draft Shape2DView object is derived from a [[Part_Part2DObject|Part Part2DObject]] and inherits all its properties. It also has the following additional properties: |
|||
===Data=== |
|||
{{TitleProperty|Draft}} |
|||
* {{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}} |
|||
===View=== |
|||
{{TitleProperty|Draft}} |
|||
* {{PropertyView|Pattern|Enumeration}}: not used. |
|||
* {{PropertyView|Pattern Size|Float}}: not used. |
|||
==Scripting== |
==Scripting== |
||
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]]. |
|||
The Draft Shape2DView tool can by used in [[macros]] and from the python console by using the following function: |
|||
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 = make_shape2dview(baseobj, projectionVector=None, facenumbers=[]) |
|||
}} |
}} |
||
* Adds a 2D shape to the document, which is a 2D projection of the given object. |
|||
* {{incode|baseobj}} is the object to be projected. |
|||
* A specific projection vector can also be given. |
|||
* {{incode|projectionVector}} is the projection vector. If not supplied the Z axis is used. |
|||
* Returns the generated object. |
|||
* |
* {{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 |
|||
Draft.makeShape2DView(FreeCAD.ActiveDocument.ActiveObject) |
|||
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() |
|||
}} |
}} |
||
<languages/> |
|||
{{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:}}}} |
|||
{{Userdocnavi{{#translation:}}}} |
Latest revision as of 19:55, 7 December 2023
2D görünüme çevir |
Menü konumu |
---|
Draft → Shape 2D View |
Tezgahlar |
Draft, Arch |
Varsayılan kısayol |
Hiçbiri |
Versiyonda tanıtıldı |
- |
Ayrıca bkz |
Hiçbiri |
Description
The Draft Shape2DView command creates 2D projections from selected objects, usually 3D solids or Arch SectionPlanes. The projections are placed in the 3D view.
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
Usage
- 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.
- Optionally select one or more objects.
- There are several ways to invoke the command:
- Press the Shape 2D view button.
- Select the Modification → Shape 2D view option from the menu.
- If you have not yet selected an object: select an object in the 3D view.
- 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.
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
- VeriAuto Update (
Bool
): specifies if the projection should be automatically recomputed if the VeriBase object changes. Selectingfalse
can be useful if there are many Draft Shape2DViews in a document or if they are complex. If set tofalse
the Std Refresh command must be used to update the projection. introduced in version 0.20 - VeriBase (
Link
): specifies the object to be projected. - VeriFace Numbers (
IntegerList
): specifies the indices of the faces to be projected. Only works if VeriProjection Mode isIndividual Faces
. - VeriFuse Arch (
Bool
): specifies if Arch objects of the same type and material are fused or not. - VeriHidden Lines (
Bool
): specifies if hidden lines are shown or not. - VeriIn Place (
Bool
): only works if the selected object is an Arch SectionPlane, and VeriProjection Mode isCutlines
orCutfaces
, specifies if the projection will appear co-planar with the section plane. - VeriProjection (
Vector
): specifies the direction of the projection. Ignored if VeriBase is an Arch SectionPlane. - VeriProjection 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 VeriFace 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
- VeriSegment Length (
Float
): specifies the size in millimeters of linear segments if VeriTessellation istrue
. - VeriTessellation (
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 VeriSegment Length is too short. - VeriVisible Only (
Bool
): specifies if the projection should only be recomputed if it is visible. - VeriExclusion 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 - VeriExclusion 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
View
Draft
- GörünümPattern (
Enumeration
): not used. - GörünümPattern Size (
Float
): not used.
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
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework
- Hubs: User hub, Power users hub, Developer hub