Stub-backed CPACS Behavior

The current package uses deterministic stand-ins from tigl_mcp.cpacs and tigl_mcp.cpacs_stubs instead of requiring full TiXI/TiGL installations.

Why this exists

  • Local development stays lightweight.

  • CI remains deterministic.

  • Tests can validate payload shapes and workflow contracts without native geometry dependencies.

What is intentionally simplified

  • Bounding boxes are derived from component index, not real geometry.

  • Sampling and intersections are synthetic but deterministic.

  • Mesh and CAD exports are format-like payloads designed for stable testing.

Utility models and parsing helpers for CPACS content.

This module reads facts that are stated directly in the CPACS XML: component UIDs, names, symmetry flags, and section/segment counts. Those are real values taken from the file.

It deliberately computes no geometry. Deriving a span, an area, a bounding box, or a surface point from CPACS requires evaluating the profile geometry through the positioning and transformation chain, which is what TiGL exists to do. Anything here that needs geometry reports it as unavailable rather than approximating it, so a caller can never mistake an estimate for a TiGL result. See tigl_mcp.cpacs_adapter.export_step for the real-TiGL path.

class tigl_mcp.cpacs.BoundingBox(xmin, xmax, ymin, ymax, zmin, zmax)[source]

Axis-aligned bounding box.

classmethod combine(boxes)[source]

Combine bounding boxes into a single envelope.

Returns None when no real box is available, rather than an empty box at the origin, which would read as a genuine measurement.

class tigl_mcp.cpacs.CPACSConfiguration(wings, fuselages, rotors, engines)[source]

Parsed CPACS configuration used by the MCP tools.

all_components()[source]

Return all components in a single list.

bounding_box()[source]

Envelope covering all components, or None if none is known.

find_component(uid)[source]

Locate a component by UID (exact match first, then case-insensitive).

class tigl_mcp.cpacs.ComponentDefinition(uid, name, index, type_name, symmetry, parameters, section_count=0, segment_count=0, component_segment_count=0, bounding_box=None)[source]

Description of a CPACS component.

Every field here is read from the CPACS file. bounding_box is None unless a real geometry kernel supplied one; it is never estimated.

class tigl_mcp.cpacs.TiglConfiguration(cpacs_configuration, closed=False)[source]

Lightweight TiGL configuration stub.

close()[source]

Mark the configuration as closed.

getEngineCount()[source]

Return the number of engines in the configuration.

getFuselageCount()[source]

Return the number of fuselages in the configuration.

getRotorCount()[source]

Return the number of rotors in the configuration.

getWingCount()[source]

Return the number of wings in the configuration.

class tigl_mcp.cpacs.TixiDocument(xml_content, file_name=None, closed=False)[source]

Lightweight TiXI document stub.

close()[source]

Mark the document as closed.

tigl_mcp.cpacs.build_handles(xml_content, file_name)[source]

Create TiXI/TiGL stand-ins from XML content.

tigl_mcp.cpacs.extract_metadata(xml_content, file_name)[source]

Extract common header metadata from CPACS content.

tigl_mcp.cpacs.parse_cpacs(xml_content)[source]

Parse CPACS XML content into a configuration representation.