TechDraw View: Difference between revisions

From FreeCAD Documentation
(The information doesn't need to be in separate notes, it can be integrated into the other sections)
mNo edit summary
(17 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>
<!--T:19-->
{{Docnav
|[[TechDraw_RedrawPage|Redraw Page]]
|[[TechDraw_ActiveView|Insert Active View]]
|[[TechDraw_Module|TechDraw]]
|IconL=TechDraw RedrawPage.svg
|IconC=Workbench_TechDraw.svg
|IconR=TechDraw_ActiveView.svg
}}

<!--T:1-->
<!--T:1-->
{{GuiCommand
{{GuiCommand
|Name=TechDraw NewView
|Name=TechDraw View
|MenuLocation=TechDraw → View
|MenuLocation=TechDraw → Insert View
|Workbenches=[[TechDraw Module|TechDraw]]
|Workbenches=[[TechDraw Module|TechDraw]]
|SeeAlso=[[TechDraw_ProjectionGroup|Insert Projection Group]], [[TechDraw_SectionView|Insert Section View]]
|SeeAlso=[[TechDraw NewProjGroup]], [[TechDraw NewSection]]
}}
}}


==Description== <!--T:2-->
==Description== <!--T:2-->

<!--T:10-->
The View tool adds a representation of one or more objects to a Drawing page. This is the basic building block of the TechDraw module. Most other Views are derived in some way from NewView.
The View tool adds a representation of one or more objects to a Drawing page. This is the basic building block of the TechDraw module. Most other Views are derived in some way from NewView.


Line 15: Line 27:
[[Image:TechDraw_View_example.png]]
[[Image:TechDraw_View_example.png]]
<translate>
<translate>
<!--T:11-->
{{Caption|View of a solid box with hidden lines}}
{{Caption|View of a solid box with hidden lines}}


==How to use== <!--T:3-->
==Usage== <!--T:3-->
# Select one or more objects (Body, App::Part, Part::Feature, Draft object, ... See Notes) in the 3D window or tree.
# If you have multiple drawing pages in your document, you will also need to select the desired page in the tree.
# Press the {{Button|[[Image:Techdraw-view.svg|16px]] [[TechDraw NewView|View]]}} button


==Options== <!--T:4-->
<!--T:12-->
# Select one or more objects (Body, App::Part, Part::Feature, Draft object, ... See Notes) in the [[3D view]] or [[Tree view]].
None.
# If you have multiple drawing pages in your document, you will also need to select the desired page in the tree. Use the {{Button|Ctrl}} to select multiple items in the tree.
# Press the {{Button|[[Image:TechDraw_View.svg|16px]] [[TechDraw View|Insert View]]}} button

<!--T:13-->
View will try to draw anything with a {{incode|Shape}} property. You can select [[Draft Workbench|Draft]] objects and [[PartDesign Body|PartDesign Bodies]] also. View will also extract any shapes from objects within an [[Std_Part|App::Part]] container or a [[Std Group|Group]].


==Properties== <!--T:5-->
==Properties== <!--T:5-->


=== Data ===
=== Data === <!--T:14-->
* {{PropertyData|X}}: The view's horizontal position on the page. (1)
* {{PropertyData|X}}: The view's horizontal position on the page. (1)
* {{PropertyData|Y}}: The view's vertical position on the page. (1)
* {{PropertyData|Y}}: The view's vertical position on the page. (1)
Line 36: Line 51:
* {{PropertyData|Caption}}: Optional short text caption.
* {{PropertyData|Caption}}: Optional short text caption.
* {{PropertyData|Source}}: Links to the Drawable Objects to be depicted
* {{PropertyData|Source}}: Links to the Drawable Objects to be depicted
* {{PropertyData|Direction}}: A vector representing the viewing direction. See note below. (1)
* {{PropertyData|Direction}}: this vector controls the direction from which you are viewing the object. +X is right, -X is left, +Y is rear, -Y is front (looking into the screen), +Z is up and -Z is down. So a Front view is (0,-1,0) and an isometric view is (1,-1,1). (1)
* {{PropertyData|XDirection}}: this vector controls the rotation of the view around the Direction. New in v0.19. (1)
* {{PropertyData|Perspective}}: True for perspective projection, false for orthogonal projection.
* {{PropertyData|Perspective}}: True for perspective projection, false for orthogonal projection.
* {{PropertyData|Focus}}: Distance from camera to projection plane for perspective projections. Needs to be adjusted to fit the object. Too far and the perspective is lost, too close and the object is distorted.
* {{PropertyData|Focus}}: Distance from camera to projection plane for perspective projections. Needs to be adjusted to fit the object. Too far and the perspective is lost, too close and the object is distorted.
* {{PropertyData|CoarseView}}: If true, TechDraw will use a polygon approximation to calculate drawing geometry. If false, TechDraw will use a precision algorithm. See Notes.
* {{PropertyData|CoarseView}}: If true, TechDraw will use a polygon approximation to calculate drawing geometry. If false, TechDraw will use a precision algorithm. CoarseView can be much faster for complex models. The quality of the drawing is reduced, since every curve is approximated as a series of short line segments. Vertices are not displayed in CoarseView since each short segment would result in two new Vertices and the display becomes cluttered. Linear Dimensions can be added to a CoarseView, but are unlikely to be useful.
:{{Emphasis|Note:}} CoarseView is affected by an upstream bug in OCCT ([https://www.freecadweb.org/tracker/view.php?id=3332 #3332]) which causes the View's position on the Page to be slightly off from the specified X,Y values.
* {{PropertyData|Smooth Visible Lines}}: Visible Smooth lines on/off.
* {{PropertyData|Smooth Visible Lines}}: Visible Smooth lines on/off.
* {{PropertyData|Seam Visible Lines}}: Visible Seam lines on/off.
* {{PropertyData|Seam Visible Lines}}: Visible Seam lines on/off.
Line 48: Line 65:
* {{PropertyData|Iso Hidden Lines}}: Hidden Isometric(u,v) lines on/off.
* {{PropertyData|Iso Hidden Lines}}: Hidden Isometric(u,v) lines on/off.
* {{PropertyData|Iso Count}}: Number of Isometric(u,v) lines to draw on each face.
* {{PropertyData|Iso Count}}: Number of Isometric(u,v) lines to draw on each face.



<!--T:8-->
<!--T:8-->
(1) these properties are common to all View types.
(1) these properties are common to all View types.


=== View ===
=== View === <!--T:9-->
<!--T:9-->
* {{PropertyView|Keep Label}}: Always show View Label if true.
* {{PropertyView|Keep Label}}: Always show View Label if true.
* {{PropertyView|LineWidth}}: The thickness of visible lines. See [[TechDraw_LineGroup|Line Groups]].
* {{PropertyView|LineWidth}}: The thickness of visible lines. See [[TechDraw_LineGroup|Line Groups]].
Line 67: Line 82:


==Scripting== <!--T:6-->
==Scripting== <!--T:6-->
{{Emphasis|See also:}} [[TechDraw API]] and [[FreeCAD Scripting Basics]].


<!--T:15-->
The New View tool can be used in [[macros]] and from the [[Python]] console by using the following functions:
{{Emphasis|See also:}} [[TechDraw API|TechDraw API]] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].

<!--T:16-->
The New View tool can be used in [[macros|macros]] and from the [[Python|Python]] console by using the following functions:


</translate>
</translate>
Line 80: Line 98:
<translate>
<translate>


<!--T:20-->
{{Docnav
|[[TechDraw_RedrawPage|Redraw Page]]
|[[TechDraw_ActiveView|Insert Active View]]
|[[TechDraw_Module|TechDraw]]
|IconL=TechDraw RedrawPage.svg
|IconC=Workbench_TechDraw.svg
|IconR=TechDraw_ActiveView.svg
}}

<!--T:17-->
{{TechDraw Tools navi}}
{{TechDraw Tools navi}}

<!--T:18-->
{{Userdocnavi}}
{{Userdocnavi}}
</translate>
</translate>

Revision as of 01:52, 10 February 2020

TechDraw View

Menu location
TechDraw → Insert View
Workbenches
TechDraw
Default shortcut
None
Introduced in version
-
See also
Insert Projection Group, Insert Section View

Description

The View tool adds a representation of one or more objects to a Drawing page. This is the basic building block of the TechDraw module. Most other Views are derived in some way from NewView.

View of a solid box with hidden lines

Usage

  1. Select one or more objects (Body, App::Part, Part::Feature, Draft object, ... See Notes) in the 3D view or Tree view.
  2. If you have multiple drawing pages in your document, you will also need to select the desired page in the tree. Use the Ctrl to select multiple items in the tree.
  3. Press the Insert View button

View will try to draw anything with a Shape property. You can select Draft objects and PartDesign Bodies also. View will also extract any shapes from objects within an App::Part container or a Group.

Properties

Data

  • DataX: The view's horizontal position on the page. (1)
  • DataY: The view's vertical position on the page. (1)
  • DataLockPosition: Prevents Views from being dragged in the Gui when true. The View can still be moved by changing X,Y properties. (1)
  • DataRotation: Counterclockwise rotation of the View on the page in degrees. (1)
  • DataScaleType: "Document": use the Page's scale setting. "Custom": use a scale unique to this view. "Automatic": fit view to page. (1)
  • DataScale: A view will be rendered on the page in Scale:1 ratio to the Source. (1)
  • DataCaption: Optional short text caption.
  • DataSource: Links to the Drawable Objects to be depicted
  • DataDirection: this vector controls the direction from which you are viewing the object. +X is right, -X is left, +Y is rear, -Y is front (looking into the screen), +Z is up and -Z is down. So a Front view is (0,-1,0) and an isometric view is (1,-1,1). (1)
  • DataXDirection: this vector controls the rotation of the view around the Direction. New in v0.19. (1)
  • DataPerspective: True for perspective projection, false for orthogonal projection.
  • DataFocus: Distance from camera to projection plane for perspective projections. Needs to be adjusted to fit the object. Too far and the perspective is lost, too close and the object is distorted.
  • DataCoarseView: If true, TechDraw will use a polygon approximation to calculate drawing geometry. If false, TechDraw will use a precision algorithm. CoarseView can be much faster for complex models. The quality of the drawing is reduced, since every curve is approximated as a series of short line segments. Vertices are not displayed in CoarseView since each short segment would result in two new Vertices and the display becomes cluttered. Linear Dimensions can be added to a CoarseView, but are unlikely to be useful.
Note: CoarseView is affected by an upstream bug in OCCT (#3332) which causes the View's position on the Page to be slightly off from the specified X,Y values.
  • DataSmooth Visible Lines: Visible Smooth lines on/off.
  • DataSeam Visible Lines: Visible Seam lines on/off.
  • DataIso Visible Lines: Visible Isometric(u,v) lines on/off.
  • DataHard Hidden Lines: Hidden lines on/off.
  • DataSmooth Hidden Lines: Hidden Smooth lines on/off.
  • DataSeam Hidden Lines: Hidden Seam lines on/off.
  • DataIso Hidden Lines: Hidden Isometric(u,v) lines on/off.
  • DataIso Count: Number of Isometric(u,v) lines to draw on each face.

(1) these properties are common to all View types.

View

  • ViewKeep Label: Always show View Label if true.
  • ViewLineWidth: The thickness of visible lines. See Line Groups.
  • ViewHiddenWidth: The thickness of hidden lines, if enabled.
  • ViewIsoWidth: The thickness of isometric(u,v) surface lines and Dimension lines.
  • ViewExtraWidth: not implemented yet.
  • ViewShowCenters: Circle/arc center marks on/off.
  • ViewCenterScale: Circular arc center mark size adjustment, if enabled.
  • ViewHorizCenterLine: Show a horizontal centerline through view.
  • ViewVertCenterLine: Show a vertical centerline through view.
  • ViewShowSectionLine: Show/hide section line if applicable.

Scripting

See also: TechDraw API and FreeCAD Scripting Basics.

The New View tool can be used in macros and from the Python console by using the following functions:

view = FreeCAD.ActiveDocument.addObject('TechDraw::DrawViewPart','View')
rc = page.addView(view)
FreeCAD.ActiveDocument.View.Source = [App.ActiveDocument.Box]
FreeCAD.ActiveDocument.View.Direction = (0.0,0.0,1.0)