draftgeoutils.general Namespace Reference

Functions

def areColinear (e1, e2)
 
def edg (p1, p2)
 
def findClosest (base_point, point_list)
 
def geomType (edge)
 
def getBoundaryAngles (angle, alist)
 
def getQuad (face)
 
def getVerts (shape)
 
def hasCurves (shape)
 
def hasOnlyWires (shape)
 
def isAligned (edge, axis="x")
 
def isNull (something)
 
def isPtOnEdge (pt, edge)
 
def isValidPath (shape)
 
def precision ()
 
def v1 (edge)
 
def vec (edge)
 

Variables

 NORM = App.Vector(0, 0, 1)
 
 PARAMGRP = App.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft")
 
 Part = lz.LazyLoader("Part", globals(), "Part")
 

Function Documentation

◆ areColinear()

def draftgeoutils.general.areColinear (   e1,
  e2 
)
Return True if both edges are colinear.

References DraftVecUtils.isNull(), and draftgeoutils.general.vec().

◆ edg()

def draftgeoutils.general.edg (   p1,
  p2 
)
Return an edge from 2 vectors.

References DraftVecUtils.equals().

◆ findClosest()

def draftgeoutils.general.findClosest (   base_point,
  point_list 
)
Find closest point in a list of points to the base point.

Returns
-------
int
    An index from the list of points is returned.

None
    If point_list is empty.

◆ geomType()

def draftgeoutils.general.geomType (   edge)
Return the type of geometry this edge is based on.

◆ getBoundaryAngles()

def draftgeoutils.general.getBoundaryAngles (   angle,
  alist 
)
Return the 2 closest angles that encompass the given angle.

◆ getQuad()

def draftgeoutils.general.getQuad (   face)
Return a list of 3 vectors if the face is a quad, ortherwise None.

Returns
-------
basepoint, Xdir, Ydir
    If the face is a quad.

None
    If the face is not a quad.

References draftgeoutils.general.vec().

◆ getVerts()

def draftgeoutils.general.getVerts (   shape)
Return a list containing vectors of each vertex of the shape.

◆ hasCurves()

def draftgeoutils.general.hasCurves (   shape)
Check if the given shape has curves.

◆ hasOnlyWires()

def draftgeoutils.general.hasOnlyWires (   shape)
Return True if all edges are inside a wire.

◆ isAligned()

def draftgeoutils.general.isAligned (   edge,
  axis = "x" 
)
Check if the given edge or line is aligned to the given axis.

The axis can be 'x', 'y' or 'z'.

◆ isNull()

def draftgeoutils.general.isNull (   something)
Return True if the given shape, vector, or placement is Null.

If the vector is (0, 0, 0), it will return True.

◆ isPtOnEdge()

def draftgeoutils.general.isPtOnEdge (   pt,
  edge 
)
Test if a point lies on an edge.

◆ isValidPath()

def draftgeoutils.general.isValidPath (   shape)
Return True if the shape can be used as an extrusion path.

◆ precision()

def draftgeoutils.general.precision ( )
Return the Draft precision setting.

◆ v1()

def draftgeoutils.general.v1 (   edge)
Return the first point of an edge.

◆ vec()

def draftgeoutils.general.vec (   edge)
Return a vector from an edge or a Part.LineSegment.

Referenced by draftgeoutils.general.areColinear(), and draftgeoutils.general.getQuad().

Variable Documentation

◆ NORM

draftgeoutils.general.NORM = App.Vector(0, 0, 1)

◆ PARAMGRP

draftgeoutils.general.PARAMGRP = App.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft")

◆ Part

draftgeoutils.general.Part = lz.LazyLoader("Part", globals(), "Part")