core.scripting

Core classes for operating on and with Shape instances via the ShapeMachine engine.

Classes

RuleApplicationType

A Rule can either be applied to a random match, all matches in parallel or to a manually-selected match.

Rule

A Rule is any operation that can be applied to a Shape.

NoOp

A Rule is any operation that can be applied to a Shape.

RuleSequence

A RuleSequence acts as a list of Rule objects with an optional label indicating the name of the sequence.

Program

A Program acts as a map of RuleSequence objects keyed by their labels.

Module attributes

DesignHistoryState

(Rule applied, [(f1(u), f1(v)), (f2(u), f2(v)), ...], selected match(es) LHS, w - f(u), selected match(es) RHS, w')

DesignHistoryState

(Rule applied, [(f1(u), f1(v)), (f2(u), f2(v)), …], selected match(es) LHS, w - f(u), selected match(es) RHS, w’)

alias of Tuple[Rule, List[Tuple[Shape, Shape]], Shape, Shape, Shape, Shape]

Submodules

shapemachine.core.scripting.jump_rule

A JumpRule contains information that enables the ShapeMachine engine to jump from one RuleSequence to another within a Program.

shapemachine.core.scripting.mark_intersection_rule

shapemachine.core.scripting.python_rule

A PythonRule allows for the execution of arbitrary Python code within a Program, which can allow for users to establish variables and functions that can later be used when evaluating an Evaluatable.

shapemachine.core.scripting.replacement_rule

A ReplacementRule computes the x -> y rule schema.

shapemachine.core.scripting.search_rule

A SearchRule searches for a Shape in a design.

shapemachine.core.scripting.utils