Hardware graph
The canonical resolved graph: nodes, ports, containment, transforms and connections.
AssemblyBuilder
Section titled “AssemblyBuilder”class in machinewright.hardware_graph
class AssemblyBuilderNo description yet.
def part( instance_key: str, definition: Any, transform: Transform | None = None) -> NodeRefassembly
Section titled “assembly”def assembly( instance_key: str, definition: Any, transform: Transform | None = None) -> NodeRefconnect
Section titled “connect”def connect( connection_key: str, source: PortRef, target: PortRef, kind: ConnectionKind) -> NoneAssemblyNode
Section titled “AssemblyNode”class in machinewright.hardware_graph
class AssemblyNode(Contract)No description yet.
ConnectionEdge
Section titled “ConnectionEdge”class in machinewright.hardware_graph
class ConnectionEdge(Contract)No description yet.
ConnectionKind
Section titled “ConnectionKind”class in machinewright.hardware_graph
class ConnectionKind(StrEnum)No description yet.
ContainmentEdge
Section titled “ContainmentEdge”class in machinewright.hardware_graph
class ContainmentEdge(Contract)No description yet.
PartNode
Section titled “PartNode”class in machinewright.hardware_graph
class PartNode(Contract)No description yet.
PortDefinition
Section titled “PortDefinition”class in machinewright.hardware_graph
class PortDefinition(Contract)No description yet.
PortInstance
Section titled “PortInstance”class in machinewright.hardware_graph
class PortInstance(Contract)No description yet.
PortRole
Section titled “PortRole”class in machinewright.hardware_graph
class PortRole(StrEnum)No description yet.
resolve_hardware
Section titled “resolve_hardware”function in machinewright.hardware_graph
def resolve_hardware( definition: Any, root_id: str = 'assembly') -> ResolvedDesignNo description yet.
ResolvedDesign
Section titled “ResolvedDesign”class in machinewright.hardware_graph
class ResolvedDesign: __init__( graph: ResolvedHardwareGraph, geometries: dict[str, cadquery.Shape], materials: dict[str, Any], source_hints: dict[str, tuple[str, int]] )No description yet.
assembly
Section titled “assembly”def assembly() -> cadquery.Assemblydef cad( exploded: bool = False, spacing: float = 30.0, nested: bool = False) -> cadquery.WorkplaneResolvedHardwareGraph
Section titled “ResolvedHardwareGraph”class in machinewright.hardware_graph
class ResolvedHardwareGraph(Contract)No description yet.
enforce_integrity
Section titled “enforce_integrity”def enforce_integrity() -> ResolvedHardwareGraphparent
Section titled “parent”def parent( node_id: str) -> str | Nonechildren
Section titled “children”def children( node_id: str) -> tuple[str, ...]descendants
Section titled “descendants”def descendants( node_id: str) -> tuple[str, ...]ports_for
Section titled “ports_for”def ports_for( node_id: str) -> tuple[PortInstance, ...]connections_for
Section titled “connections_for”def connections_for( identity: str) -> tuple[ConnectionEdge, ...]neighbors
Section titled “neighbors”def neighbors( node_id: str, kind: ConnectionKind | None = None) -> tuple[str, ...]connected_subgraph
Section titled “connected_subgraph”def connected_subgraph( node_id: str) -> tuple[str, ...]validate_graph
Section titled “validate_graph”def validate_graph() -> ValidationReportto_dot
Section titled “to_dot”def to_dot() -> strTransform
Section titled “Transform”class in machinewright.hardware_graph
class Transform(Contract)No description yet.
identity
Section titled “identity”def identity() -> Transformtranslated
Section titled “translated”def translated( x: float = 0, y: float = 0, z: float = 0) -> Transformfrom_location
Section titled “from_location”def from_location( location: cadquery.Location) -> Transformlocation
Section titled “location”def location() -> cadquery.Locationcompose
Section titled “compose”def compose( child: Transform) -> Transform