Draft Shape2DView: Difference between revisions

From FreeCAD Documentation
(More information on the "how to use". Will be moved to properties.)
(More details for the properties)
Line 42: Line 42:


<!--T:9-->
<!--T:9-->
* {{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".
** Normally the projection is "Solid".
* {{PropertyData|In Place}}: If this is True, when using Cutlines or Cutfaces mode ([[Arch SectionPlane]] only), the result will appear at the cut plane location instead of the ground plane {{Version|0.17}}
** If the initial selection are faces of a solid, the "Individual Faces" mode will project only those faces.
* {{PropertyData|HiddenLines}}: Shows hidden lines or not
** If the selection is an [[Arch SectionPlane]].
* {{PropertyData|Tessellation}}: Tessellate Ellipses and BSplines into line segments
** If the selection is an [[Arch SectionPlane]].
* {{PropertyData|Segment Length}}: The size of segments if Tessellation is turned on
* {{PropertyData|In Place}}: if it is {{TRUE}}, together with "Cutlines" or "Cutfaces" modes, the resulting projection will appear at the position of the cut plane. {{Version|0.17}}
* {{PropertyData|Visible Only}}: If True, this view will be recomputed only if it is visible
* {{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}}.
* {{PropertyData|Visible Only}}: if it is {{TRUE}} the projection will be recomputed only if it is visible.


==Scripting== <!--T:10-->
==Scripting== <!--T:10-->

Revision as of 17:28, 14 November 2018

Draft Shape2DView

Menu location
Draft → Shape 2D View
Workbenches
Draft, Arch
Default shortcut
None
Introduced in version
-
See also
Part Workbench, TechDraw Workbench

Description

This 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 TechDraw NewView and 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.

How to use

  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 projection direction can be changed after creation with the property editor.

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.

The default projection mode is "Solid", which projects the whole shape. If only some faces of the base are selected, thje projection mode can be set to "Individual Faces", which will project only the faces that were selected. If the selected object is an Arch SectionPlane, "Cutlines" and "Cutfaces" modes are also available. The first one will project only the edges being cut by the section plane; the latter one displays the cut areas of solids as faces.

Options

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

Properties

  • DataProjection: 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.
  • DataProjection Mode: it can be "Solid", "Individual Faces", "Cutlines", and "Cutfaces".
    • Normally the projection is "Solid".
    • If the initial selection are faces of a solid, the "Individual Faces" mode will project only those faces.
    • If the selection is an Arch SectionPlane.
    • If the selection is an Arch SectionPlane.
  • DataIn Place: if it is true, together with "Cutlines" or "Cutfaces" modes, the resulting projection will appear at the position of the cut plane. introduced in version 0.17
  • DataHiddenLines: if it is true it will show the hidden lines of the projection.
  • DataTessellation: 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 DataSegment Length is very small.
  • DataSegment Length: specifies the size in millimeters of linear segments if DataTessellation is true.
  • DataVisible Only: if it is true the projection will be recomputed only if it is visible.

Scripting

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

makeShape2DView (object,[projection],[facenumbers])
  • Adds a 2D shape to the document, which is a 2D projection of the given object.
  • A specific projection vector can also be given.
  • Returns the generated object.
  • You can also provide a list of face numbers to be considered.

Example:

import FreeCAD,Draft
Draft.makeShape2DView(FreeCAD.ActiveDocument.ActiveObject)