Package empro :: Module empro :: Module geometry :: Class Sketch
[frames] | no frames]

Class Sketch

core.Updatable --+            
                 |            
   core.Selectable --+        
                     |        
     core.Attributable --+    
                         |    
                      Part --+
                             |
                            Sketch

Interface to a sketch. Sketches can be part of a recipe to build up a Model that can act as a body in the simulation.

Class Hierarchy for Sketch
Class Hierarchy for Sketch

constructor Sketch(): Creates an empty sketch to draw on. constructor Sketch(iCoordinateSystem): Creates an empty sketch to draw on using a given CoordinateSystem.

Instance Methods
list[string]
add(iBB)
Adds a rectangle to the sketch given by a bounding box in two dimensions.
string
addEdge(iEdge)
Adds an Edge to the sketch.
list[string]
addEdges(iEdges)
Adds a list of Edges to the sketch.
None
clear()
Clears the sketch.
ConstraintManager
constraintManager()
Returns the attached constraint manager.
Sketch
deserialize(xml)
Static method, deserialize XML representation of definition to Python object.
None
deserializeEx()
Method not for use.
list(string)
edgeIds(iSketch)
Returns the edge ids of the specified sketch.
string
filletVertex(iName, iRadius)
Applies a fillet to the given vertex with the specified radius.
bool
insertVertex(iName, iPosition)
Inserts a vertex into the sketch on the given edge.
bool
isEmpty()
Returns True when the sketch is empty.
bool
move(iName, iOffset)
Moves an edge by a given offset.
bool
removeEdge(iName)
Removes an Edge from the sketch given its name.
str
serialize()
Serialize sketch to XML
None
serializeEx()
Method not for use.
list(Sketch)
split(iSketch)
Splits the specified sketch.
list(string)
vertexIds(iSketch)
Returns the vertex ids of the specified sketch.

Inherited from Part: age, badFaces, boundingBox, centeredBoundingBox, check, checkLumps, cloneFlatten, exportFaceToSAT, exportToSAB, exportToSAT, faceCentroid, faceNormalAtCentroid, faces, facetFaces, hide, importCad, importCadWithUnits, inspectPart, locatorList, project, show, slice, sliceLineFacets, touchGeometry

Inherited from core.Attributable: addAttribute, attributeNames, getAttribute, removeAttribute, setAttribute

Inherited from core.Selectable: clone, isSelected

Inherited from core.Updatable: __enter__, __exit__, hash, isValid, reasonWhyInvalid

Properties

Inherited from Part: appearance, cadId, coordinateSystem, gridParameters, material, meshParameters, priority, unit, visible

Inherited from core.Selectable: metaData, name, notes

Method Details

add(iBB)

 

Adds a rectangle to the sketch given by a bounding box in two dimensions.

Parameters:
Returns: list[string]

addEdge(iEdge)

 

Adds an Edge to the sketch.

Parameters:
  • iEdge (Edge) - The edge to add.
Returns: string

addEdges(iEdges)

 

Adds a list of Edges to the sketch.

Parameters:
  • iEdges (list[Edge]) - The list of edges to add.
Returns: list[string]

deserialize(xml)

 

Static method, deserialize XML representation of definition to Python object.

Parameters:
  • xml (str) - XML representation of sketch.
Returns: Sketch

edgeIds(iSketch)

 

Returns the edge ids of the specified sketch.

Parameters:
  • iSketch (Sketch) - The sketch for which the edge ids must be obtained.
Returns: list(string)

filletVertex(iName, iRadius)

 

Applies a fillet to the given vertex with the specified radius.

Parameters:
  • iName (string) - The vertex identifier.
  • iRadius (Expression) - The radius of the fillet.
Returns: string

insertVertex(iName, iPosition)

 

Inserts a vertex into the sketch on the given edge.

Parameters:
  • iName (string) - The edge to insert a vertex on.
  • iPosition (Vector3d) - The vertex to insert.
Returns: bool

move(iName, iOffset)

 

Moves an edge by a given offset.

Parameters:
  • iName (string) - The edge to move.
  • iOffset (Vector3d) - The offset to move the edge.
Returns: bool

removeEdge(iName)

 

Removes an Edge from the sketch given its name.

Parameters:
  • iName (string) - The edge to remove.
Returns: bool

serialize()

 

Serialize sketch to XML

Returns: str
Overrides: Part.serialize

serializeEx()

 

Method not for use.

Returns: None
Overrides: Part.serializeEx

split(iSketch)

 

Splits the specified sketch.

Parameters:
  • iSketch (Sketch) - The sketch to be split.
Returns: list(Sketch)

vertexIds(iSketch)

 

Returns the vertex ids of the specified sketch.

Parameters:
  • iSketch (Sketch) - The sketch for which the vertex ids must be obtained.
Returns: list(string)