Draft Shape2DView/cs: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 46: Line 46:


==Vlastnosti==
==Vlastnosti==

See also: [[property_editor|Property editor]].

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


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 51: Line 59:
* {{PropertyData|Projection Mode}}: Projekční mód: těleso, individuální plochy nebo řezné čáry.
* {{PropertyData|Projection Mode}}: Projekční mód: těleso, individuální plochy nebo řezné čáry.
</div>
</div>

===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==
Line 63: Line 84:


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


Line 73: Line 94:
</div>
</div>


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


Příklad:
Příklad:


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

doc = App.newDocument()


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


Shape1 = Draft.makeShape2DView(Box)
shape1 = Draft.make_shape2dview(box)


Shape2 = Draft.makeShape2DView(Box, FreeCAD.Vector(1, -1, 1))
shape2 = Draft.make_shape2dview(box, App.Vector(1, -1, 1))


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


FreeCAD.ActiveDocument.recompute()
doc.recompute()
}}
}}



Revision as of 09:54, 1 June 2021

This documentation is a work in progress. Please don't mark it as translatable since it will change in the next hours and days.

Kreslení TělesoDo2DPohledu

Umístění Menu
Kreslení -> TělesoDo2D
Pracovní stoly
Kreslení, Architektura
Výchozí zástupce
Nikdo
Představen ve verzi
-
Viz také
Nikdo

Popis

Tento nástroj umístí do dokumentu 2D objekt, který vznikne zploštěním pohledu vybraného tvaru založeného na objektu díl.

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

Použití

  1. Vyberte objekt, ze kterého chcete extrahovat 2D pohled
  2. Stiskněte tlačítko Kreslení TělesoDo2D

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.

Volby

  • Je-li vybraný objekt v Architektura Řez, bude ve 2D projekci obsah řezu, a projekční vektor bude převzat z řezu místo z vlastnosti Projekce (dále).
  • Normální operační mód je Těleso, který promítá celý tvar, ale pokud při vytváření 2D pohledu vyberete některou plochu ze základního objektu, můžete také nastavit mód Individuální plochy, což zajistí, že budou promítnuty pouze vybrané povrchy.
  • Je-li vybraný objekt v Architektura Řez, je k dispozici i projekční mód řezné čáry, který promítá pouze hrany řezu.

Vlastnosti

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

  • ÚdajeProjection: Směr projekce.
  • ÚdajeProjection Mode: Projekční mód: těleso, individuální plochy nebo řezné čáry.

View

Draft

  • PohledPattern (Enumeration): not used.
  • PohledPattern 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

Skriptování

Nástroj TělesoDo2D může být použit v makrech a z konzoly Pythonu použitím následující funkce:

shape2dview = make_shape2dview(baseobj, projectionVector=None, facenumbers=[])
  • Přidá 2D tvar do dokumentu, tvar je 2D projekce zadaného objektu.
  • Může být specifikován projekční vektor.
  • Vrací vygenerovaný objekt.
  • Může být zadán seznam čísel ploch, které mají být použity.

Change the ProjectionMode property of the created object if required. It can be: "Solid", "Individual Faces", "Cutlines", "Cutfaces" or "Solid faces".

Příklad:

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()