Modules with functions for use with scripted objects and GuiCommands. More...

Functions

def draftfunctions.array.array (objectslist, arg1, arg2, arg3, arg4=None, arg5=None, arg6=None)
 
def draftfunctions.move.copy_moved_edge (object, edge_index, vector)
 
def draftfunctions.move.copy_moved_edges (arguments)
 
def draftfunctions.rotate.copy_rotated_edge (object, edge_index, angle, center, axis)
 
def draftfunctions.rotate.copy_rotated_edges (arguments)
 
def draftfunctions.scale.copy_scaled_edge (obj, edge_index, scale, center)
 
def draftfunctions.scale.copy_scaled_edges (arguments)
 
def draftfunctions.cut.cut (object1, object2)
 
def draftfunctions.downgrade.downgrade (objects, delete=False, force=None)
 
def draftfunctions.draftify.draftify (objectslist, makeblock=False, delete=True)
 
def draftfunctions.draftify.draftify_shape (shape)
 
def draftfunctions.extrude.extrude (obj, vector, solid=False)
 
def draftfunctions.svg.format_point (coords, action='L')
 
def draftfunctions.fuse.fuse (object1, object2)
 
def draftfunctions.svg.get_arrow (obj, arrowtype, point, arrowsize, color, linewidth, angle=0)
 
def draftfunctions.svgshapes.get_circle (plane, fill, stroke, linewidth, lstyle, edge)
 
def draftfunctions.svgshapes.get_discretized (edge, plane)
 
def draftfunctions.dxf.get_dxf (obj, direction=None)
 
def draftfunctions.svgshapes.get_ellipse (plane, fill, stroke, linewidth, lstyle, edge)
 
def draftfunctions.svg.get_line_style (line_style, scale)
 
def draftfunctions.svg.get_overshoot (point, shootsize, color, linewidth, angle=0)
 
def draftfunctions.svgshapes.get_path (obj, plane, fill, pathdata, stroke, linewidth, lstyle, fill_opacity=None, edges=[], wires=[], pathname=None)
 
def draftfunctions.svg.get_pattern (pat)
 
def draftfunctions.svg.get_print_color (obj)
 
def draftfunctions.svgshapes.get_proj (vec, plane=None)
 
def draftfunctions.svg.get_svg (obj, scale=1, linewidth=0.35, fontsize=12, fillstyle="shape color", direction=None, linestyle=None, color=None, linespacing=None, techdraw=False, rotation=0, fillspaces=False, override=True)
 
def draftfunctions.svgtext.get_text (plane, techdraw, tcolor, fontsize, fontname, angle, base, text, linespacing=0.5, align="center", flip=True)
 
def draftfunctions.svg.getArrow (obj, arrowtype, point, arrowsize, color, linewidth, angle=0)
 
def draftfunctions.svgshapes.getCircle (plane, fill, stroke, linewidth, lstyle, edge)
 
def draftfunctions.svgshapes.getDiscretized (edge, plane)
 
def draftfunctions.dxf.getDXF (obj, direction=None)
 
def draftfunctions.svgshapes.getEllipse (plane, fill, stroke, linewidth, lstyle, edge)
 
def draftfunctions.svg.getLineStyle (linestyle, scale)
 
def draftfunctions.svg.getOvershoot (point, shootsize, color, linewidth, angle=0)
 
def draftfunctions.svgshapes.getPath (obj, plane, fill, pathdata, stroke, linewidth, lstyle, fill_opacity, edges=[], wires=[], pathname=None)
 
def draftfunctions.svg.getPattern (pat)
 
def draftfunctions.svgshapes.getProj (vec, plane=None)
 
def draftfunctions.svg.getSVG (obj, scale=1, linewidth=0.35, fontsize=12, fillstyle="shape color", direction=None, linestyle=None, color=None, linespacing=None, techdraw=False, rotation=0, fillSpaces=False, override=True)
 
def draftfunctions.svgtext.getText (plane, techdraw, tcolor, fontsize, fontname, angle, base, text, linespacing=0.5, align="center", flip=True)
 
def draftfunctions.heal.heal (objlist=None, delete=True, reparent=True)
 
def draftfunctions.join.join_two_wires (wire1, wire2)
 
def draftfunctions.join.join_wires (wires, joinAttempts=0)
 
def draftfunctions.mirror.mirror (objlist, p1, p2)
 
def draftfunctions.move.move (objectslist, vector, copy=False)
 
def draftfunctions.move.move_edge (object, edge_index, vector)
 
def draftfunctions.move.move_vertex (object, vertex_index, vector)
 
def draftfunctions.offset.offset (obj, delta, copy=False, bind=False, sym=False, occ=False)
 
def draftfunctions.array.polarArray (objectslist, center, angle, num)
 
def draftfunctions.array.rectArray (objectslist, xvector, yvector, xnum, ynum)
 
def draftfunctions.array.rectArray2 (objectslist, xvector, yvector, zvector, xnum, ynum, znum)
 
def draftfunctions.rotate.rotate (objectslist, angle, center=App.Vector(0, 0, 0), axis=App.Vector(0, 0, 1), copy=False)
 
def draftfunctions.rotate.rotate_edge (object, edge_index, angle, center, axis)
 
def draftfunctions.rotate.rotate_vector_from_center (vector, angle, axis, center)
 
def draftfunctions.rotate.rotate_vertex (object, vertex_index, angle, center, axis)
 
def draftfunctions.scale.scale (objectslist, scale=App.Vector(1, 1, 1), center=App.Vector(0, 0, 0), copy=False)
 
def draftfunctions.scale.scale_edge (obj, edge_index, scale, center)
 
def draftfunctions.scale.scale_vector_from_center (vector, scale, center)
 
def draftfunctions.scale.scale_vertex (obj, vertex_index, scale, center)
 
def draftfunctions.split.split (wire, newPoint, edgeIndex)
 
def draftfunctions.split.split_closed_wire (wire, edgeIndex)
 
def draftfunctions.split.split_open_wire (wire, newPoint, edgeIndex)
 
def draftfunctions.upgrade.upgrade (objects, delete=False, force=None)
 

Variables

def draftfunctions.move.copyMovedEdges = copy_moved_edges
 
def draftfunctions.rotate.copyRotatedEdges = copy_rotated_edges
 
def draftfunctions.scale.copyScaledEdge = copy_scaled_edge
 
def draftfunctions.scale.copyScaledEdges = copy_scaled_edges
 
 draftfunctions.draftify.DraftGeomUtils = lz.LazyLoader("DraftGeomUtils", globals(), "DraftGeomUtils")
 
def draftfunctions.join.joinTwoWires = join_two_wires
 
def draftfunctions.join.joinWires = join_wires
 
def draftfunctions.move.moveEdge = move_edge
 
def draftfunctions.move.moveVertex = move_vertex
 
 draftfunctions.draftify.Part = lz.LazyLoader("Part", globals(), "Part")
 
def draftfunctions.rotate.rotateEdge = rotate_edge
 
def draftfunctions.rotate.rotateVectorFromCenter = rotate_vector_from_center
 
def draftfunctions.rotate.rotateVertex = rotate_vertex
 
def draftfunctions.scale.scaleEdge = scale_edge
 
def draftfunctions.scale.scaleVectorFromCenter = scale_vector_from_center
 
def draftfunctions.scale.scaleVertex = scale_vertex
 
def draftfunctions.split.splitClosedWire = split_closed_wire
 
def draftfunctions.split.splitOpenWire = split_open_wire
 

Detailed Description

Modules with functions for use with scripted objects and GuiCommands.

Function Documentation

◆ array()

def draftfunctions.array.array (   objectslist,
  arg1,
  arg2,
  arg3,
  arg4 = None,
  arg5 = None,
  arg6 = None 
)
This function creates an array of independent objects.
Use makeArray() to create a parametric array object.

Creates an array of the given objects (that can be an object or a list
of objects).

In case of rectangular array, xnum of iterations in the x direction
at xvector distance between iterations, and same for y and z directions
with yvector and ynum and zvector and znum.

In case of polar array, center is a vector, totalangle is the angle
to cover (in degrees) and totalnum is the number of objects, including
the original.

Use
---
array(objectslist, xvector, yvector, xnum, ynum) for rectangular array

array(objectslist, xvector, yvector, zvector, xnum, ynum, znum) for rectangular array

array(objectslist, center, totalangle, totalnum) for polar array

References draftfunctions.array.polarArray(), draftfunctions.array.rectArray(), and draftfunctions.array.rectArray2().

Referenced by App::Document.getPathsByOutList(), nlohmann::detail.hash(), nlohmann::detail::json_sax_dom_parser< BasicJsonType >.start_array(), and nlohmann::detail::json_sax_dom_callback_parser< BasicJsonType >.start_array().

◆ copy_moved_edge()

def draftfunctions.move.copy_moved_edge (   object,
  edge_index,
  vector 
)
Needed for SubObjects modifiers.
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).

Referenced by draftfunctions.move.copy_moved_edges().

◆ copy_moved_edges()

def draftfunctions.move.copy_moved_edges (   arguments)
Needed for SubObjects modifiers.
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).

References draftfunctions.move.copy_moved_edge().

◆ copy_rotated_edge()

def draftfunctions.rotate.copy_rotated_edge (   object,
  edge_index,
  angle,
  center,
  axis 
)
Needed for SubObjects modifiers.
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).

References draftfunctions.rotate.rotate_vector_from_center().

Referenced by draftfunctions.rotate.copy_rotated_edges().

◆ copy_rotated_edges()

def draftfunctions.rotate.copy_rotated_edges (   arguments)
Needed for SubObjects modifiers.
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).

References draftfunctions.rotate.copy_rotated_edge().

◆ copy_scaled_edge()

def draftfunctions.scale.copy_scaled_edge (   obj,
  edge_index,
  scale,
  center 
)
Needed for SubObjects modifiers.
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).

References draftfunctions.scale.scaleVectorFromCenter.

◆ copy_scaled_edges()

def draftfunctions.scale.copy_scaled_edges (   arguments)
Needed for SubObjects modifiers.
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).

References draftfunctions.scale.copyScaledEdge.

◆ cut()

def draftfunctions.cut.cut (   object1,
  object2 
)
Return a cut object made from the difference of the 2 given objects.

Parameters
----------
object1: Part::Feature
    Any object with a `Part::TopoShape`.

object2: Part::Feature
    Any object with a `Part::TopoShape`.

Returns
-------
Part::Cut
    The resulting cut object.

None
    If there is a problem and the new object can't be created.

Referenced by MRichTextEdit.MRichTextEdit().

◆ downgrade()

def draftfunctions.downgrade.downgrade (   objects,
  delete = False,
  force = None 
)
Downgrade the given objects.

This is a counterpart to `upgrade`.

Parameters
----------
objects: Part::Feature or list
    A single object to downgrade or a list
    containing various such objects.

delete: bool, optional
    It defaults to `False`.
    If it is `True`, the old objects are deleted, and only the resulting
    object is kept.

force: str, optional
    It defaults to `None`.
    Its value can be used to force a certain method of downgrading.
    It can be any of: `'explode'`, `'shapify'`, `'subtr'`, `'splitFaces'`,
    `'cut2'`, `'getWire'`, `'splitWires'`, or `'splitCompounds'`.

Returns
-------
tuple
    A tuple containing two lists, a list of new objects
    and a list of objects to be deleted.

None
    If there is a problem it will return `None`.

See Also
--------
ugrade

◆ draftify()

def draftfunctions.draftify.draftify (   objectslist,
  makeblock = False,
  delete = True 
)
draftify(objectslist,[makeblock],[delete])

Turn each object of the given list (objectslist can also be a single 
object) into a Draft parametric wire. 

TODO: support more objects

Parameters
----------
objectslist :

makeblock : bool
    If makeblock is True, multiple objects will be grouped in a block.

delete : bool
    If delete = False, old objects are not deleted

References draftfunctions.draftify.draftify_shape().

◆ draftify_shape()

def draftfunctions.draftify.draftify_shape (   shape)

◆ extrude()

def draftfunctions.extrude.extrude (   obj,
  vector,
  solid = False 
)
extrude(object, vector, [solid])

Create a Part::Extrusion object from a given object.

Parameters
----------
obj :

vector : Base.Vector
    The extrusion direction and module.

solid : bool
    TODO: describe.

◆ format_point()

def draftfunctions.svg.format_point (   coords,
  action = 'L' 
)

◆ fuse()

def draftfunctions.fuse.fuse (   object1,
  object2 
)
fuse(oject1, object2)

Returns an object made from the union of the 2 given objects. 
If the objects are coplanar, a special Draft Wire is used, otherwise we use
a standard Part fuse.

◆ get_arrow()

def draftfunctions.svg.get_arrow (   obj,
  arrowtype,
  point,
  arrowsize,
  color,
  linewidth,
  angle = 0 
)
Get the SVG representation from an arrow.

Referenced by draftfunctions.svg.format_point(), draftfunctions.svg.get_svg(), and draftfunctions.svg.getArrow().

◆ get_circle()

def draftfunctions.svgshapes.get_circle (   plane,
  fill,
  stroke,
  linewidth,
  lstyle,
  edge 
)

◆ get_discretized()

def draftfunctions.svgshapes.get_discretized (   edge,
  plane 
)

◆ get_dxf()

def draftfunctions.dxf.get_dxf (   obj,
  direction = None 
)
Return a DXF entity from the given object.

If direction is given, the object is projected in 2D.

References DraftVecUtils.isNull().

Referenced by draftfunctions.dxf.getDXF().

◆ get_ellipse()

def draftfunctions.svgshapes.get_ellipse (   plane,
  fill,
  stroke,
  linewidth,
  lstyle,
  edge 
)
Get the SVG representation from an elliptical edge.

References draftfunctions.svgshapes.get_proj().

Referenced by draftfunctions.svgshapes.getEllipse().

◆ get_line_style()

def draftfunctions.svg.get_line_style (   line_style,
  scale 
)
Return a linestyle scaled by a factor.

Referenced by draftfunctions.svg.get_svg(), and draftfunctions.svg.getLineStyle().

◆ get_overshoot()

def draftfunctions.svg.get_overshoot (   point,
  shootsize,
  color,
  linewidth,
  angle = 0 
)
Get the SVG representation of a dimension line overshoot.

Referenced by draftfunctions.svg.format_point(), and draftfunctions.svg.getOvershoot().

◆ get_path()

def draftfunctions.svgshapes.get_path (   obj,
  plane,
  fill,
  pathdata,
  stroke,
  linewidth,
  lstyle,
  fill_opacity = None,
  edges = [],
  wires = [],
  pathname = None 
)
Get the SVG representation from an object's edges or wires.

TODO: the `edges` and `wires` must not default to empty list `[]`
but to `None`. Verify that the code doesn't break with this change.

`edges` and `wires` are mutually exclusive. If no `wires` are provided,
sort the `edges`, and use them. If `wires` are provided, sort the edges
in these `wires`, and use them.

References draftfunctions.svgshapes.get_proj().

Referenced by draftfunctions.svg.format_point(), draftfunctions.svg.get_svg(), and draftfunctions.svgshapes.getPath().

◆ get_pattern()

def draftfunctions.svg.get_pattern (   pat)
Get an SVG pattern.

Referenced by draftfunctions.svg.get_svg(), and draftfunctions.svg.getPattern().

◆ get_print_color()

def draftfunctions.svg.get_print_color (   obj)
returns the print color of the parent layer, if available

Referenced by draftfunctions.svg.get_svg().

◆ get_proj()

def draftfunctions.svgshapes.get_proj (   vec,
  plane = None 
)
Get a projection of the vector in the plane's u and v directions.

TODO: check if the same function for SVG and DXF projection can be used
so that this function is not just duplicated code.
This function may also be present elsewhere, like `WorkingPlane`
or `DraftGeomUtils`, so we should avoid code duplication.

Parameters
----------
vec: Base::Vector3
    An arbitrary vector that will be projected on the U and V directions.

plane: WorkingPlane.Plane
    An object of type `WorkingPlane`.

References DraftVecUtils.project().

Referenced by draftfunctions.svg.format_point(), draftfunctions.svgshapes.get_circle(), draftfunctions.svgshapes.get_discretized(), draftfunctions.svgshapes.get_ellipse(), draftfunctions.svgshapes.get_path(), draftfunctions.svg.get_svg(), draftfunctions.svgshapes.getDiscretized(), and draftfunctions.svgshapes.getProj().

◆ get_svg()

def draftfunctions.svg.get_svg (   obj,
  scale = 1,
  linewidth = 0.35,
  fontsize = 12,
  fillstyle = "shape color",
  direction = None,
  linestyle = None,
  color = None,
  linespacing = None,
  techdraw = False,
  rotation = 0,
  fillspaces = False,
  override = True 
)
Return a string containing an SVG representation of the object.

Paramaeters
-----------
scale: float, optional
    It defaults to 1.
    It allows scaling line widths down, so they are resolution-independent.

linewidth: float, optional
    It defaults to 0.35.

fontsize: float, optional
    It defaults to 12, which is interpreted as `pt` unit (points).
    It is used if the given object contains any text.

fillstyle: str, optional
    It defaults to 'shape color'.

direction: Base::Vector3, optional
    It defaults to `None`.
    It is an arbitrary projection vector or a `WorkingPlane.Plane`
    instance.

linestyle: optional
    It defaults to `None`.

color: optional
    It defaults to `None`.

linespacing: float, optional
    It defaults to `None`.

techdraw: bool, optional
    It defaults to `False`.
    If it is `True`, it sets some options for generating SVG strings
    for displaying inside TechDraw.

rotation: float, optional
    It defaults to 0.

fillspaces: bool, optional
    It defaults to `False`.

override: bool, optional
    It defaults to `True`.

References DraftVecUtils.angle(), draftfunctions.svg.format_point(), draftfunctions.svg.get_arrow(), draftfunctions.svgshapes.get_circle(), draftfunctions.svg.get_line_style(), draftfunctions.svgshapes.get_path(), draftfunctions.svg.get_pattern(), draftfunctions.svg.get_print_color(), draftfunctions.svgshapes.get_proj(), WorkingPlane.plane, and DraftVecUtils.rotate().

Referenced by draftfunctions.svg.getSVG().

◆ get_text()

def draftfunctions.svgtext.get_text (   plane,
  techdraw,
  tcolor,
  fontsize,
  fontname,
  angle,
  base,
  text,
  linespacing = 0.5,
  align = "center",
  flip = True 
)
Get the SVG representation of a textual element.

Referenced by draftfunctions.svgtext.getText().

◆ getArrow()

def draftfunctions.svg.getArrow (   obj,
  arrowtype,
  point,
  arrowsize,
  color,
  linewidth,
  angle = 0 
)
Get the SVG representation from an arrow. DEPRECATED.

References draftfunctions.svg.get_arrow().

◆ getCircle()

def draftfunctions.svgshapes.getCircle (   plane,
  fill,
  stroke,
  linewidth,
  lstyle,
  edge 
)
Get the SVG representation from a circular edge.

References draftfunctions.svgshapes.get_circle().

Referenced by importIFCHelper.get2DShape().

◆ getDiscretized()

def draftfunctions.svgshapes.getDiscretized (   edge,
  plane 
)

◆ getDXF()

def draftfunctions.dxf.getDXF (   obj,
  direction = None 
)
Return DXF string of the object. DEPRECATED. Use 'get_dxf'.

References draftfunctions.dxf.get_dxf().

◆ getEllipse()

def draftfunctions.svgshapes.getEllipse (   plane,
  fill,
  stroke,
  linewidth,
  lstyle,
  edge 
)
Get the SVG representation from an elliptical edge. DEPRECATED.

References draftfunctions.svgshapes.get_ellipse().

◆ getLineStyle()

def draftfunctions.svg.getLineStyle (   linestyle,
  scale 
)
Return a Line style. DEPRECATED. Use get_line_style.

References draftfunctions.svg.get_line_style().

◆ getOvershoot()

def draftfunctions.svg.getOvershoot (   point,
  shootsize,
  color,
  linewidth,
  angle = 0 
)
Get the SVG representation of a dimension line overshoot. DEPRECATED.

References draftfunctions.svg.get_overshoot().

◆ getPath()

def draftfunctions.svgshapes.getPath (   obj,
  plane,
  fill,
  pathdata,
  stroke,
  linewidth,
  lstyle,
  fill_opacity,
  edges = [],
  wires = [],
  pathname = None 
)

◆ getPattern()

def draftfunctions.svg.getPattern (   pat)
Get an SVG pattern. DEPRECATED.

References draftfunctions.svg.get_pattern().

◆ getProj()

def draftfunctions.svgshapes.getProj (   vec,
  plane = None 
)
Get a projection of a vector. DEPRECATED.

References draftfunctions.svgshapes.get_proj().

◆ getSVG()

def draftfunctions.svg.getSVG (   obj,
  scale = 1,
  linewidth = 0.35,
  fontsize = 12,
  fillstyle = "shape color",
  direction = None,
  linestyle = None,
  color = None,
  linespacing = None,
  techdraw = False,
  rotation = 0,
  fillSpaces = False,
  override = True 
)
Return SVG string of the object. DEPRECATED. Use 'get_svg'.

References draftfunctions.svg.get_svg().

◆ getText()

◆ heal()

def draftfunctions.heal.heal (   objlist = None,
  delete = True,
  reparent = True 
)
heal([objlist],[delete],[reparent])

Recreate Draft objects that are damaged, for example if created from an
earlier version. If ran without arguments, all the objects in the document 
will be healed if they are damaged.

Parameters
----------
objlist : list

delete : Base.Vector or list of Base.Vector
    If delete is True, the damaged objects are deleted (default).

reparent : bool
    If reparent is True (default), new objects go at the very same place 
    in the tree than their original.

◆ join_two_wires()

def draftfunctions.join.join_two_wires (   wire1,
  wire2 
)
joinTwoWires(object, object): joins two wires if they share a common
point as a start or an end.

BUG: it occasionally fails to join lines even if the lines
visually share a point.
This is a rounding error in the comparison of the shared point;
a small difference will result in the points being considered different
and thus the lines not joining.
Test properly using `DraftVecUtils.equals` because then it will consider
the precision set in the Draft preferences.

◆ join_wires()

def draftfunctions.join.join_wires (   wires,
  joinAttempts = 0 
)
joinWires(objects): merges a set of wires where possible, if any of those
wires have a coincident start and end point

References draftfunctions.join.joinTwoWires, and draftfunctions.join.joinWires.

◆ mirror()

def draftfunctions.mirror.mirror (   objlist,
  p1,
  p2 
)
Create a mirror object from the provided list and line.

It creates a `Part::Mirroring` object from the given `objlist` using
a plane that is defined by the two given points `p1` and `p2`,
and either

- the Draft working plane normal, or
- the negative normal provided by the camera direction
  if the working plane normal does not exist and the graphical interface
  is available.

If neither of these two is available, it uses as normal the +Z vector.

Parameters
----------
objlist: single object or a list of objects
    A single object or a list of objects.

p1: Base::Vector3
    Point 1 of the mirror plane. It is also used as the `Placement.Base`
    of the resulting object.

p2: Base::Vector3
    Point 1 of the mirror plane.

Returns
-------
None
    If the operation fails.

list
    List of `Part::Mirroring` objects, or a single one
    depending on the input `objlist`.

To Do
-----
Implement a mirror tool specific to the workbench that does not
just use `Part::Mirroring`. It should create a derived object,
that is, it should work similar to `Draft.offset`.

◆ move()

def draftfunctions.move.move (   objectslist,
  vector,
  copy = False 
)
move(objects,vector,[copy])

Move the objects contained in objects (that can be an object or a
list of objects) in the direction and distance indicated by the given
vector. 

Parameters
----------
objectslist : list

vector : Base.Vector
    Delta Vector to move the clone from the original position. 

copy : bool
    If copy is True, the actual objects are not moved, but copies
    are created instead. 

Return
----------
The objects (or their copies) are returned.

Referenced by nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >.accept(), App::ObjectIdentifier.addComponent(), Sketcher::SketchObject.addConstraint(), Sketcher::SketchObject.addConstraints(), Sketcher::SketchObject.addCopy(), Sketcher::SketchObject.addCopyOfConstraints(), Sketcher::SketchObject.addGeometry(), Gui::SelectionSingleton.addSelection(), Gui::SelectionSingleton.addSelections(), Sketcher::SketchObject.addSymmetric(), App::PropertyXLinkSubList.addValue(), Path::Area.addWire(), App::PropertyLinkSub.adjustLink(), App::PropertyXLink.adjustLink(), App::PropertyXLinkSubList.adjustLink(), App::PropertyExpressionEngine.afterRestore(), App::PropertyXLinkContainer.afterRestore(), nlohmann::detail::json_sax_dom_parser< BasicJsonType >.binary(), nlohmann::detail::json_sax_dom_callback_parser< BasicJsonType >.binary(), nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >.binary(), Path::Area.build(), Gui::PropertyEditor::PropertyEditor.buildUp(), Sketcher::SketchObject.carbonCopy(), Sketcher::SketchObject.changeConstraintsLocking(), App::PropertyLinkBase.checkLabelReferences(), Gui::SelectionSingleton.clearCompleteSelection(), GEOMUtils.CompsolidToCompound(), nlohmann::detail::external_constructor< value_t::array >.construct(), nlohmann::detail::external_constructor< value_t::binary >.construct(), nlohmann::detail::external_constructor< value_t::object >.construct(), nlohmann::detail::external_constructor< value_t::string >.construct(), Gui::PropertyEditor::PropertyEditor.contextMenuEvent(), Base.convertTo(), Sketcher::SketchObject.convertToNURBS(), Part::GeometryDefaultExtension< T >.copy(), Part::GeometryMigrationExtension.copy(), Sketcher::ExternalGeometryExtension.copy(), Sketcher::SketchGeometryExtension.copy(), Sketcher::SolverGeometryExtension.copy(), SketcherGui::ViewProviderSketchGeometryExtension.copy(), App::PropertyLinkSub.CopyOnImportExternal(), App::PropertyLinkSubList.CopyOnImportExternal(), Spreadsheet::PropertySheet.CopyOnImportExternal(), App::PropertyLinkSub.CopyOnLabelChange(), App::PropertyLinkSubList.CopyOnLabelChange(), Spreadsheet::PropertySheet.CopyOnLabelChange(), App::PropertyLinkList.CopyOnLinkReplace(), App::PropertyLinkSub.CopyOnLinkReplace(), App::PropertyLinkSubList.CopyOnLinkReplace(), Spreadsheet::PropertySheet.CopyOnLinkReplace(), App::PropertyXLink.copyTo(), nlohmann::detail::iterator_input_adapter_factory< IteratorType, Enable >.create(), nlohmann::detail::iterator_input_adapter_factory< IteratorType, enable_if_t< is_iterator_of_multibyte< IteratorType >::value > >.create(), Sketcher::SketchObject.delAllExternal(), Sketcher::SketchObject.delConstraint(), Sketcher::SketchObject.delConstraintOnPoint(), Sketcher::SketchObject.delConstraints(), Sketcher::SketchObject.delConstraintsToExternal(), Sketcher::SketchObject.delExternal(), Sketcher::SketchObject.delGeometriesExclusiveList(), Sketcher::SketchObject.delGeometry(), App::DocumentObjectT.DocumentObjectT(), SketcherGui::ViewProviderSketch.draw(), PartDesignGui::ViewProviderBody.dropObject(), PartDesignGui::ViewProviderSubShapeBinder.dropObjectEx(), nlohmann::ordered_map< Key, T, IgnoredLess, Allocator >.erase(), App::ObjectIdentifier::Component.FC_DEFAULT_CTORS(), App::ObjectIdentifier.FC_DEFAULT_CTORS(), App::ObjectIdentifier::String.FC_DEFAULT_CTORS(), nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >.from_bson(), nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >.from_cbor(), nlohmann::detail.from_json(), nlohmann::detail.from_json_array_impl(), nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >.from_msgpack(), nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >.from_ubjson(), nlohmann::detail::span_input_adapter.get(), Base::MatrixPy.getA(), SMESH_subMesh.getCollection(), App::PropertyLinkSubList.getLinks(), App::PropertyXLinkSubList.getLinks(), App::Document.getLinksTo(), App::SubObjectT.getNewElementName(), App::SubObjectT.getOldElementName(), App::PropertyExpressionEngine.hasSetValue(), Spreadsheet::PropertySheet.hasSetValue(), App::Expression.importSubNames(), Sketcher::SketchObject.increaseBSplineDegree(), nlohmann::ordered_map< Key, T, IgnoredLess, Allocator >.insert(), MeshCore::MeshProjection.isPointInsideDistance(), Gui::MainWindow.loadWindowSettings(), Part::FaceMakerCheese.makeFace(), Part::TopoShape.makeHelix(), Part::TopoShape.makeLongHelix(), Part::TopoShape.makeOffset2D(), App::ObjectIdentifier::Component.MapComponent(), Sketcher::SketchObject.modifyBSplineKnotMultiplicity(), Gui::Flag.mouseMoveEvent(), CArea.move(), Base::Matrix4D.move(), nlohmann::detail::json_ref< BasicJsonType >.moved_or_copied(), Sketcher::SketchObject.moveDatumsToEnd(), Gui::SelectionSingleton.notify(), App::LinkBaseExtension.onExtendedDocumentRestored(), Gui::PropertyView.onTimer(), nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >.operator+=(), nlohmann::json_pointer< BasicJsonType >.operator/=(), App::ObjectIdentifier.operator<<(), App::DocumentObjectT.operator=(), Gui::SelectionChanges.operator=(), App::SubObjectT.operator=(), nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >.parse(), StdCmdExpression.pasteExpressions(), nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >.patch(), Sketcher::SketchObject.port_reversedExternalArcs(), nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >.push_back(), nlohmann::json_pointer< BasicJsonType >.push_back(), App::PropertyLinkBase.registerLabelReferences(), App::ObjectIdentifier.relativeTo(), Part::TopoShape.removeSplitter(), Gui::ViewProviderDocumentObject.replaceObject(), App::ObjectIdentifier.resolveAmbiguity(), Part::PropertyGeometryList.Restore(), App::PropertyLinkSub.Restore(), App::PropertyLinkSubList.Restore(), App::PropertyXLink.Restore(), Sketcher::PropertyConstraintList.Restore(), Gui::SelectionSingleton.rmvPreselect(), Gui::SelectionSingleton.rmvSelection(), nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >.sax_parse(), Gui::SelectionChanges.SelectionChanges(), Gui::SelectionSingleton.selStackGoBack(), Gui::SelectionSingleton.selStackGoForward(), Gui::SelectionSingleton.selStackPush(), Sketcher::SketchObject.setActive(), App::ObjectIdentifier.setComponent(), Sketcher::SketchObject.setConstruction(), Spreadsheet::Cell.setContent(), Sketcher::SketchObject.setDatum(), Sketcher::SketchObject.setDatumsDriving(), App::ObjectIdentifier.setDocumentName(), App::ObjectIdentifier.setDocumentObjectName(), Sketcher::SketchObject.setDriving(), App::PropertyExpressionEngine.setExpressions(), Spreadsheet::PropertySheet.setExpressions(), Part::GeometryPy.setExtension(), Sketcher::ExternalGeometryFacadePy.setExtension(), Sketcher::GeometryFacadePy.setExtension(), Part::Geometry.setExtension(), Sketcher::ExternalGeometryFacade.setExtension(), Sketcher::GeometryFacade.setExtension(), Sketcher::SketchObjectPy.setGeometryFacadeList(), Sketcher::SketchObject.setGeometryId(), App::LinkBaseExtension.setLink(), PartDesign::SubShapeBinder.setLinks(), Gui::SelectionSingleton.setPreselect(), App::PropertyLinkSub.setPyObject(), App::PropertyXLink.setPyObject(), App::PropertyXLinkSubList.setPyObject(), App::PropertyListsT< T, ListT, ParentT >.setPyValues(), App::PropertyXLinkSubList.setSubListValues(), App::PropertyXLink.setSubName(), App::PropertyXLink.setSubValues(), App::PropertyXLink.setValue(), App::PropertyLinkSub.setValue(), App::PropertyXLinkSubList.setValue(), Sketcher::PropertyConstraintList.setValues(), App::PropertyXLinkSubList.setValues(), App::PropertyLinkSubList.setValues(), Part::PropertyGeometryList.setValues(), Sketcher::SketchObject.setVirtualSpace(), App::ObjectIdentifier::Component.SimpleComponent(), App::ObjectIdentifier.SimpleComponent(), Gui::SelectionSingleton.slotDeletedObject(), nlohmann::detail.to_json(), Sketcher::SketchObject.toggleActive(), Sketcher::SketchObject.toggleConstruction(), Sketcher::SketchObject.toggleDriving(), Sketcher::SketchObject.toggleVirtualSpace(), Sketcher::SketchObject.transferConstraints(), Sketcher::SketchObject.transferFilletConstraints(), Sketcher::SketchObject.trim(), App::PropertyLinkBase.tryReplaceLink(), App::PropertyLinkBase.tryReplaceLinkSubs(), App::PropertyXLinkContainer.updateDeps(), Sketcher::Sketch.updateExtension(), App::PropertyLinkBase.updateLabelReferences(), Gui::SelectionSingleton.updateSelection(), Sketcher::SketchObject.updateSolverExtension(), App::PropertyXLinkSubList.upgrade(), Sketcher::SketchObject.validateConstraints(), and Sketcher::SketchObject.validateExternalLinks().

◆ move_edge()

def draftfunctions.move.move_edge (   object,
  edge_index,
  vector 
)
Needed for SubObjects modifiers.
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).

References draftfunctions.move.moveVertex.

◆ move_vertex()

def draftfunctions.move.move_vertex (   object,
  vertex_index,
  vector 
)
Needed for SubObjects modifiers.
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).

◆ offset()

def draftfunctions.offset.offset (   obj,
  delta,
  copy = False,
  bind = False,
  sym = False,
  occ = False 
)
offset(object,delta,[copymode],[bind])

Offset the given wire by applying the given delta Vector to its first 
vertex.

Parameters
----------
obj :

delta : Base.Vector or list of Base.Vector
    If offsetting a BSpline, the delta must not be a Vector but a list
    of Vectors, one for each node of the spline.

copy : bool
    If copymode is True, another object is created, otherwise the same
    object gets offsetted.

copy : bool
    If bind is True, and provided the wire is open, the original
    and the offset wires will be bound by their endpoints, forming a face.

sym : bool
    if sym is True, bind must be true too, and the offset is made on both
    sides, the total width being the given delta length.

References draftmake.make_bspline.makeBSpline, draftmake.make_circle.makeCircle, draftmake.make_polygon.makePolygon, draftmake.make_rectangle.makeRectangle, draftmake.make_wire.makeWire, DraftVecUtils.project(), and DraftVecUtils.rotate().

Referenced by geoff_geometry::SpanVertex.Add(), geoff_geometry::SpanVertex.AddSpanID(), geoff_geometry.CPTOL(), TechDrawGui::QGIFace.dashRemain(), AdaptivePath::Adaptive2d.Execute(), geoff_geometry::SpanVertex.Get(), geoff_geometry::Kurve.Get(), Spreadsheet::Sheet.getColumn(), geoff_geometry::SpanVertex.GetIndex(), TechDraw::DrawViewBalloon.getOriginOffset(), Spreadsheet::Sheet.getRow(), geoff_geometry::SpanVertex.GetSpanID(), PartDesign::PolarPattern.getTransformations(), Part::Extrusion.makeDraft(), Part::TopoShapePy.makeOffset2D(), Part::TopoShapePy.makeOffsetShape(), Part::TopoShapePy.makeThickness(), geoff_geometry::Span.Offset(), TechDrawGui::QGIFace.offsetDash(), Part::TopoShapeSolidPy.offsetFaces(), geoff_geometry::Kurve.OffsetMethod1(), PartGui::OffsetWidget.OffsetWidget(), Part::OffsetCurve2dPy.PyInit(), Part::OffsetCurvePy.PyInit(), Part::OffsetSurfacePy.PyInit(), and zipios::ZipCDirEntry.setLocalHeaderOffset().

◆ polarArray()

def draftfunctions.array.polarArray (   objectslist,
  center,
  angle,
  num 
)

◆ rectArray()

def draftfunctions.array.rectArray (   objectslist,
  xvector,
  yvector,
  xnum,
  ynum 
)

◆ rectArray2()

def draftfunctions.array.rectArray2 (   objectslist,
  xvector,
  yvector,
  zvector,
  xnum,
  ynum,
  znum 
)

◆ rotate()

def draftfunctions.rotate.rotate (   objectslist,
  angle,
  center = App.Vector(0,0,0),
  axis = App.Vector(0,0,1),
  copy = False 
)
rotate(objects,angle,[center,axis,copy])

Rotates the objects contained in objects (that can be a list of objects
or an object) of the given angle (in degrees) around the center, using
axis as a rotation axis.

Parameters
----------
objectlist : list

angle : list

center : Base.Vector

axis : Base.Vector
    If axis is omitted, the rotation will be around the vertical Z axis.

copy : bool
    If copy is True, the actual objects are not moved, but copies
    are created instead.

Return
----------
The objects (or their copies) are returned.

References DraftVecUtils.rotate(), and DraftVecUtils.tup().

Referenced by TechDraw::CenterLine.calcEndPoints(), TechDraw::CenterLine.calcEndPoints2Lines(), TechDraw::CenterLine.calcEndPoints2Points(), and geoff_geometry::Matrix.Rotate().

◆ rotate_edge()

def draftfunctions.rotate.rotate_edge (   object,
  edge_index,
  angle,
  center,
  axis 
)
Needed for SubObjects modifiers.
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).

References draftfunctions.rotate.rotateVertex.

◆ rotate_vector_from_center()

def draftfunctions.rotate.rotate_vector_from_center (   vector,
  angle,
  axis,
  center 
)
Needed for SubObjects modifiers.
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).

References DraftVecUtils.rotate().

Referenced by draftfunctions.rotate.copy_rotated_edge(), and draftfunctions.rotate.rotate_vertex().

◆ rotate_vertex()

def draftfunctions.rotate.rotate_vertex (   object,
  vertex_index,
  angle,
  center,
  axis 
)
Needed for SubObjects modifiers.
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).

References draftfunctions.rotate.rotate_vector_from_center().

◆ scale()

def draftfunctions.scale.scale (   objectslist,
  scale = App.Vector(1,1,1),
  center = App.Vector(0,0,0),
  copy = False 
)
scale(objects, scale, [center], copy)

Scales the objects contained in objects (that can be a list of objects or 
an object) of the given  around given center. 

Parameters
----------
objectlist : list

scale : Base.Vector
    Scale factors defined by a given vector (in X, Y, Z directions).

objectlist : Base.Vector
    Center of the scale operation.

copy : bool
    If copy is True, the actual objects are not scaled, but copies
    are created instead. 

Return
----------
The objects (or their copies) are returned.

References DraftVecUtils.project(), and draftfunctions.scale.scale_vertex().

Referenced by Gui::NavigationStyle.boxZoom(), TechDraw::CenterLine.calcEndPoints(), TechDraw::CenterLine.calcEndPoints2Lines(), TechDraw::CenterLine.calcEndPoints2Points(), TechDrawGui::TaskRichAnno.calcTextStartPos(), TechDrawGui::QGCustomImage.centerAt(), TechDrawGui::QGCustomSvg.centerAt(), StdMeshers_Regular_1D.computeInternalParameters(), TechDrawGui::QGILeaderLine.draw(), TechDrawGui::QGIViewBalloon.drawBalloon(), TechDrawGui::QGIViewPart.drawMatting(), TechDrawGui::QGIViewPart.drawSectionLine(), TechDraw::DrawViewDimExtent.execute(), DrawingGui::OrthoViews.get_configs(), TechDrawGui::TaskDetail.getAnchorScene(), DrawingGui::orthoview.getScale(), Gui::AxisOrigin.getScale(), Path::Voronoi::diagram_type.getScale(), SketcherGui::ViewProviderSketch.getScaleFactor(), Gui::SoAutoZoomTranslation.getScaleFactor(), SketcherGui::SoZoomTranslation.getScaleFactor(), SketcherGui::SoDatumLabel.GLRender(), TechDrawGui::QGVPage.keyPressEvent(), SMESH_Pattern.Load(), TechDraw::DrawGeomHatch.makeEdgeOverlay(), TechDrawGui::TaskCosVertex.onTrackerFinished(), TechDrawGui::TaskLeaderLine.onTrackerFinished(), Gui::NavigationStyle.processMotionEvent(), TechDraw::DrawViewDimension.saveArrowPositions(), Base::Matrix4D.scale(), Base::Rotation.setValue(), AdaptivePath.SmoothPaths(), Path::Command.toGCode(), geoff_geometry::Circle.Transform(), RotTransDragger.valueChangedCB(), Gui::View3DInventorPy.viewDefaultOrientation(), DrawingGui::SvgView.wheelEvent(), and TechDrawGui::QGVPage.wheelEvent().

◆ scale_edge()

def draftfunctions.scale.scale_edge (   obj,
  edge_index,
  scale,
  center 
)
Needed for SubObjects modifiers.
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).

References draftfunctions.scale.scaleVertex.

◆ scale_vector_from_center()

def draftfunctions.scale.scale_vector_from_center (   vector,
  scale,
  center 
)
Needed for SubObjects modifiers.
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).

◆ scale_vertex()

def draftfunctions.scale.scale_vertex (   obj,
  vertex_index,
  scale,
  center 
)
Needed for SubObjects modifiers.
Implemented by Dion Moult during 0.19 dev cycle (works only with Draft Wire).

References draftfunctions.scale.scaleVectorFromCenter.

Referenced by draftfunctions.scale.scale().

◆ split()

def draftfunctions.split.split (   wire,
  newPoint,
  edgeIndex 
)

◆ split_closed_wire()

def draftfunctions.split.split_closed_wire (   wire,
  edgeIndex 
)

◆ split_open_wire()

def draftfunctions.split.split_open_wire (   wire,
  newPoint,
  edgeIndex 
)

◆ upgrade()

def draftfunctions.upgrade.upgrade (   objects,
  delete = False,
  force = None 
)
Upgrade the given objects.

This is a counterpart to `downgrade`.

Parameters
----------
objects: Part::Feature or list
    A single object to upgrade or a list
    containing various such objects.

delete: bool, optional
    It defaults to `False`.
    If it is `True`, the old objects are deleted, and only the resulting
    object is kept.

force: str, optional
    It defaults to `None`.
    Its value can be used to force a certain method of upgrading.
    It can be any of: `'makeCompound'`, `'closeGroupWires'`,
    `'makeSolid'`, `'closeWire'`, `'turnToParts'`, `'makeFusion'`,
    `'makeShell'`, `'makeFaces'`, `'draftify'`, `'joinFaces'`,
    `'makeSketchFace'`, `'makeWires'`.

Returns
-------
tuple
    A tuple containing two lists, a list of new objects
    and a list of objects to be deleted.

None
    If there is a problem it will return `None`.

See Also
--------
downgrade

References draftgeoutils.geometry.is_straight_line().

Variable Documentation

◆ copyMovedEdges

def draftfunctions.move.copyMovedEdges = copy_moved_edges

◆ copyRotatedEdges

def draftfunctions.rotate.copyRotatedEdges = copy_rotated_edges

◆ copyScaledEdge

def draftfunctions.scale.copyScaledEdge = copy_scaled_edge

◆ copyScaledEdges

def draftfunctions.scale.copyScaledEdges = copy_scaled_edges

◆ DraftGeomUtils

draftfunctions.draftify.DraftGeomUtils = lz.LazyLoader("DraftGeomUtils", globals(), "DraftGeomUtils")

◆ joinTwoWires

def draftfunctions.join.joinTwoWires = join_two_wires

◆ joinWires

def draftfunctions.join.joinWires = join_wires

◆ moveEdge

def draftfunctions.move.moveEdge = move_edge

◆ moveVertex

def draftfunctions.move.moveVertex = move_vertex

◆ Part

draftfunctions.draftify.Part = lz.LazyLoader("Part", globals(), "Part")

◆ rotateEdge

def draftfunctions.rotate.rotateEdge = rotate_edge

◆ rotateVectorFromCenter

def draftfunctions.rotate.rotateVectorFromCenter = rotate_vector_from_center

◆ rotateVertex

def draftfunctions.rotate.rotateVertex = rotate_vertex

◆ scaleEdge

def draftfunctions.scale.scaleEdge = scale_edge

◆ scaleVectorFromCenter

def draftfunctions.scale.scaleVectorFromCenter = scale_vector_from_center

◆ scaleVertex

def draftfunctions.scale.scaleVertex = scale_vertex

◆ splitClosedWire

def draftfunctions.split.splitClosedWire = split_closed_wire

◆ splitOpenWire

def draftfunctions.split.splitOpenWire = split_open_wire