sketchgraphs.data.constraint_checks¶
This module implements a basic constraint checker for a solved graph.
This module implements a number of functions to help check basic relational constraints between entities. Note that only checking is implemented: this is not an implementation of a solver, and cannot solve for the desired constraints.
Functions
-
sketchgraphs.data.constraint_checks.
check_edge_satisfied
(seq, op: sketchgraphs.data.sequence.EdgeOp)¶ Determines whether the given EdgeOp instance is geometrically satisfied in the graph represented by
seq
.- Parameters
- Returns
True
if the current edge constraint is satisified, otherwiseFalse
.- Return type
- Raises
ValueError – If the current constraint is not supported (e.g. its type is not supported), or it refers to an external entity, which is not supported.
-
sketchgraphs.data.constraint_checks.
coincident
(*entities)¶
-
sketchgraphs.data.constraint_checks.
concentric
(*ents)¶
-
sketchgraphs.data.constraint_checks.
equal
(*ents)¶
-
sketchgraphs.data.constraint_checks.
get_entity_by_idx
(seq, idx: int) → sketchgraphs.data._entity.Entity¶ Returns the entity or sub-entity corresponding to idx.
- Parameters
- Returns
An entity object representing the entity corresponding to the
NodeOp
at the given index.- Return type
Entity
-
sketchgraphs.data.constraint_checks.
get_sorted_types
(entities)¶ Obtains the types and sorts the entities based on their type order.
- Parameters
entities (iterable of
Entity
) – An list of entities to be sorted.- Returns
types (List) – A list of types representing the type of each entity
entities (List) – A list of entities, containing the same elements as the input iterable, but sorted in the order given by types.
-
sketchgraphs.data.constraint_checks.
horizontal
(*ents)¶
-
sketchgraphs.data.constraint_checks.
midpoint
(*ents)¶
-
sketchgraphs.data.constraint_checks.
parallel
(*ents)¶
-
sketchgraphs.data.constraint_checks.
perpendicular
(*ents)¶
-
sketchgraphs.data.constraint_checks.
tangent
(*ents)¶
-
sketchgraphs.data.constraint_checks.
vertical
(*ents)¶