|
|
| Menu location |
|---|
| Модификация → Shape 2D View |
| Workbenches |
| Чертожна маса |
| Default shortcut |
| None |
| Introduced in version |
| - |
| See also |
| Draft UpdateShape2DView, TechDraw ProjectShape |
Командата Draft Shape2DView създава 2D проекции от избрани обекти, обикновено 3D твърди тела или Arch SectionPlanes. Проекциите се поставят в 3D изгледа.
Проекциите Draft Shape2DView могат да се показват на страница от работна маса Технически чертеж с помощта на командата TechDraw DraftView. Алтернативно работната маса Технически чертеж предлагат свои собствени проекционни команди. Но те създават проекции, които се показват само на страницата за чертеж, а не в 3D изглед/bg.
Проекция на твърди форми върху XY-равнината
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.
See also: Property View.
A Draft Shape2DView object is derived from a Part Part2DObject and inherits all its properties. It also has the following additional properties:
Draft
Bool): specifies if the projection should be automatically recomputed if the Данни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 Draft UpdateShape2DView command must be used to update the projection.Link): specifies the object to be projected.Bool): if this is True, the contents are clipped to the borders of the section plane, if applicable. This overrides the base object's Clip property.IntegerList): specifies the indices of the faces to be projected. Only works if ДанниProjection Mode is Individual Faces.Bool): specifies if BIM objects of the same type and material are fused or not.Bool): specifies if hidden lines are shown or not.Bool): only works if the selected object is an Arch SectionPlane, and ДанниProjection Mode is Cutlines or Cutfaces, specifies if the projection will appear co-planar with the section plane.Vector): specifies the direction of the projection. Ignored if ДанниBase is an Arch SectionPlane.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 the Solid mode gives wrong results.Float): specifies the size in millimeters of linear segments if ДанниTessellation is true.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.Bool): specifies if the projection should only be recomputed if it is visible.Vector list): A list of exclusion points. Any edge passing through any of those points will not be drawn.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 0.21Draft
Enumeration): specifies the Draft Pattern with which to fill the projected faces of solids in the Draft Shape2DView. This property only works if ДанниProjection Mode is Cutfaces and if ВидDisplay Mode is Flat Lines.Float): specifies the size of the Draft Pattern.See also: Autogenerated API documentation and FreeCAD Scripting Basics.
To create a 2D projection use the make_shape2dview method of the Draft module.
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()