Code Documentation¶
ADA¶
The main library.
- class ada.Assembly(name='Ada', project='AdaProject', user: User = User(user_id='AdaUser', given_name=None, family_name=None, middle_names=None, prefix_titles=None, suffix_titles=None, org_id='ADA', org_name='Assembly For Design and Analysis', org_description=None, role='Engineer'), schema='IFC4X3_add2', metadata=None, units: Units | str = Units.M, ifc_class: SpatialTypes = SpatialTypes.IfcSite)¶
The Assembly object. A top level container of parts, beams, plates, shapes and FEM.
- read_fem(fem_file: str | os.PathLike, fem_format: FEATypes | str = None, name: str = None, fem_converter: FemConverters | str = 'default')¶
Import a Finite Element model. Currently supported FEM formats: Abaqus, Sesam and Calculix
- read_ifc(ifc_file: str | os.PathLike | ifcopenshell.file, data_only=False, elements2part=None)¶
Import from IFC file.
- to_fem(name: str, fem_format: FEATypes | str, scratch_dir=None, metadata=None, execute=False, run_ext=False, cpus=1, gpus=None, overwrite=False, fem_converter='default', exit_on_complete=True, run_in_shell=False, make_zip_file=False, return_fea_results=True, model_data_only=False, write_input_files_only=False) FEAResult | None¶
Create a FEM input file deck for executing fem analysis in a specified FEM format. Currently there is limited write support for the following FEM formats:
Open Source
Calculix
Code_Aster
not open source
Abaqus
Usfos
Sesam
Write support is added on a need-only-basis. Any contributions are welcomed!
- Parameters:
name – Name of FEM analysis input deck
fem_format – Desired fem format
scratch_dir – Output directory for analysis input deck
metadata – Parse additional commands to FEM solver not supported by the generalized classes
execute – Execute analysis on complete
run_ext – Run analysis externally or wait for complete
cpus – Number of cpus for running the analysis
gpus – Number of gpus for running the analysis (wherever relevant)
overwrite – Overwrite existing input file deck
fem_converter – Set desired fem converter. Use either ‘default’ or ‘meshio’.
exit_on_complete
run_in_shell
make_zip_file
return_fea_results – Automatically import the result mesh into
model_data_only – Only write the model data (nodes, elements, etc.) to the FEM file
write_input_files_only –
Only write the input files, do not execute the analysis
Note! Meshio implementation currently only supports reading & writing elements and nodes.
Abaqus Metadata:
‘ecc_to_mpc’: Runs the method
convert_ecc_to_mpc(). Default is True ‘hinges_to_coupling’: Runs the methodconvert_hinges_2_couplings(). Default is TrueImportant Note! The ecc_to_mpc and hinges_to_coupling will make permanent modifications to the model. If this proves to create issues regarding performance this should be evaluated further.
- class ada.Beam(name, n1: Node | Iterable, n2: Node | Iterable, sec: str | Section, mat: str | Material = None, up=None, angle=0.0, e1=None, e2=None, units=Units.M, hi1: BeamHinge = None, hi2: BeamHinge = None, justification: Justification | str = Justification.NA, **kwargs)¶
The base Beam object
- Parameters:
n1 – Start position of beam. List or Node object
n2 – End position of beam. List or Node object
sec – Section definition. Str or Section Object
mat – Material. Str or Material object. String: [‘S355’ & ‘S420’] (default is ‘S355’ if None is parsed)
name – Name of beam
- static array_from_list_of_coords(list_of_coords: list[tuple | Point], sec: Section | str, mat: Material | str = None, name_gen: Iterable = None, make_closed=False) list[Beam]¶
Create an array of beams from a list of coordinates
- bbox() BoundingBox¶
Bounding Box of beam
- copy_to(name: str = None, p1=None, p2=None, rotation_axis: Iterable[float] = None, rotation_angle: float = None) Beam¶
Copy beam to new position
- get_node_on_beam_by_fraction(fraction: float) Node¶
Returns node as a fraction of the beam length from n1-node.
- property length: float¶
Returns the length of the beam
- line_occ()¶
Wire/edge body as an opaque CAD
ShapeHandle(seesolid_occ()for the handle contract).
- property ori¶
Get the x-vector, y-vector and z-vector of a given beam
- property orientation: Placement¶
This is the local orientation and position of the Beam within the local placement object
- shell_occ() ShapeHandle¶
Shell/face body as an opaque CAD
ShapeHandle(seesolid_occ()for the handle contract).
- solid_occ() ShapeHandle¶
Solid body for this object as an opaque CAD
ShapeHandle.The handle is the cross-subsystem lingua franca (tessellation, IFC, clash, bbox, FEM all consume it). Treat it as opaque — its concrete type is backend-private (a
TopoDS_Solid/TopoDS_Compoundunder the default OCC backend). Operate on it via the CAD backend verbs, not by importing kernel types. See dap plan/v3 notes_occ_backend_abstraction (Phase 2).
- class ada.BeamHinge(name: 'str', dofs: 'list[BeamHingeDofType]')¶
- class ada.BeamHingeDofType(dof: 'DofType', constraint_type: 'BeamHingeConstraintType', spring_stiffness: 'float' = 0.0)¶
- class ada.BeamRevolve(name: str, curve: CurveRevolve, sec: str | Section, up=None, **kwargs)¶
- solid_geom() Geometry[RevolvedAreaSolid]¶
Revolve the section profile around the curve’s rotation axis.
The profile is placed perpendicular to the arc at
p1and revolved. The placement frame is X = radial (p1 -> away from axis), Y = rotation axis (the section “up”), Z = arc tangent (the profile normal).The revolution
axisis in global coordinates — the convention both CAD backends build from. The IFC writer converts it to the Position-local frame thatIfcRevolvedAreaSolid.Axisrequires.
- class ada.BeamSweep(name: str, curve: CurveOpen2d, sec: str | Section, **kwargs)¶
- class ada.BeamTapered(name, n1: Iterable, n2: Iterable, sec: str | Section, tap: str | Section = None, taper_type: TaperTypes | str = TaperTypes.CENTERED, **kwargs)¶
- class ada.Bolts(name, p1, p2, normal, members, parent=None)¶
TODO: Create a bolt class based on the IfcMechanicalFastener concept.
Which in turn should likely be inside another element components class
- class ada.BoolHalfSpace(origin: Point | Iterable[float], normal: Direction | Iterable[float], flip=False, name: str = None, plane_geo_width: float = 1.0, **kwargs)¶
- solid_occ() ShapeHandle¶
Solid body for this object as an opaque CAD
ShapeHandle.The handle is the cross-subsystem lingua franca (tessellation, IFC, clash, bbox, FEM all consume it). Treat it as opaque — its concrete type is backend-private (a
TopoDS_Solid/TopoDS_Compoundunder the default OCC backend). Operate on it via the CAD backend verbs, not by importing kernel types. See dap plan/v3 notes_occ_backend_abstraction (Phase 2).
- class ada.Boolean(primitive, bool_op: BoolOpEnum = BoolOpEnum.DIFFERENCE, metadata=None, parent=None, units=Units.M, guid=None)¶
- class ada.Connection(name: str, spec_name: str | None = None, spec_inputs: dict[str, Any] | None = None, **kwargs: Any)¶
A Part subclass for connection components (e.g. welded joints).
Owns the geometry of the connection itself — sample/host members, stiffener plates (via add_plate), boolean cutting objects (via add_boolean on the contained beams), and welds (via add_weld). Carries optional lineage attrs spec_name and spec_inputs so a Connection built from a registered ConnectionSpec can be round-tripped.
- class ada.ConstraintConceptCurve(name: 'str', start_pos: 'Iterable | Point', end_pos: 'Iterable | Point', dof_constraints: 'list[ConstraintConceptDofType]')¶
- class ada.ConstraintConceptDofType(dof: 'DofType', constraint_type: 'ConstraintType', spring_stiffness: 'float' = 0.0)¶
- static encastre(dof_type: Literal['fixed', 'free', 'spring', 'prescribed', 'dependent', 'super'] = 'fixed') list[ConstraintConceptDofType]¶
All 6 dofs are fixed
- static pinned() list[ConstraintConceptDofType]¶
All 3 translational dofs are fixed, and all 3 rotational dofs are free.
- class ada.ConstraintConceptPoint(name: 'str', position: 'Point | Iterable', dof_constraints: 'list[ConstraintConceptDofType]')¶
- class ada.ConstraintConceptRigidLink(name: 'str', master_point: 'Iterable | Point', influence_region: 'RigidLinkRegion', dof_constraints: 'list[ConstraintConceptDofType]', rotation_dependent: 'bool' = True, include_all_edges: 'bool' = True)¶
- class ada.CurvePoly2d(points2d, origin: Iterable | Point = None, normal: Iterable | Direction = None, xdir: Iterable | Direction = None, tol=0.001, parent=None, orientation: Placement = None)¶
A closed curve defined by a list of 2d points represented by line and arc segments.
- classmethod from_fem_shell(points3d, tol=0.001, parent=None) CurvePoly2d¶
Fast constructor for flat FEM shell elements (3- or 4-gon, no arcs/radii).
Geometrically equivalent to
from_3d_pointsfor a radius-free polygon, but it (a) computes the orientation once and injects it viaPlacement.from_dirs_precomputed(), so the computed-placement LRU is never touched (it thrashes on per-element placements), and (b) builds the closed line loop directly instead of runningbuild_polycurve/SegCreator. Used only by the FEM shell -> Plate conversion; the generalfrom_3d_pointspath (arcs, fillets, radii) is unchanged.
- class ada.Direction(*coords: float | int | Iterable[float])¶
- class ada.Equipment(name: str, mass: float, cog: Iterable[float] | Point, origin: Iterable[float] | Point, lx: float, ly: float, lz: float, eq_repr: EquipRepr = EquipRepr.AS_IS, load_case_ref: str | LoadConceptCase = None, moment_equilibrium: bool = True, footprint: list[tuple[float, float]] = None)¶
- class ada.FEM(name: 'str', metadata: 'Dict' = <factory>, parent: 'Part' = None, nodes: 'Nodes' = <factory>, ref_points: 'Nodes' = <factory>, ref_sets: 'FemSets' = <factory>, elements: 'FemElements' = <factory>, sets: 'FemSets' = <factory>, sections: 'FemSections' = <factory>, initial_state: 'PredefinedField' = None, subroutine: 'str' = None)¶
- add_interface_nodes(interface_nodes: List[Node | InterfaceNode])¶
Nodes used for interfacing between other parts. Pass a custom Constraint if specific coupling is needed
- add_set(fem_set: FemSet, p=None, vol_box=None, vol_cyl=None, single_member=False, tol=0.0001) FemSet¶
- Parameters:
fem_set – A fem set object
p – Single point (x,y,z)
vol_box – Search by a box volume. Where p is (xmin, ymin, zmin) and vol_box is (xmax, ymax, zmax)
vol_cyl – Search by cylindrical volume. Used together with p to find nodes within cylinder inputted by [radius, height, thickness]
single_member – Set True if you wish to keep only a single member
tol – Point Tolerances. Default is 1e-4
- add_step(step: _step_types) _step_types¶
Add an analysis step to the assembly
- create_fem_elem_from_obj(obj, el_type=None) Elem¶
Converts structural object to FEM elements. Currently only BEAM is supported
- get_all_bcs() Iterable[Bc]¶
Get all the boundary conditions in the entire assembly
- get_all_masses() Iterable[Mass]¶
Get all the Masses in the entire assembly
- class ada.Group(name: 'str', members: 'list[Part | Beam | Plate | Wall | Pipe | Shape]', parent: 'Part | Assembly', description: 'str' = '', guid: 'str' = <factory>, change_type: 'ChangeAction' = <ChangeAction.NOTDEFINED: 'NOTDEFINED'>)¶
- class ada.Instance(instance_ref: "Union['Part', 'BackendGeom']", placements: 'List[Placement]' = <factory>)¶
- class ada.IntermittentSpec(pitch: float, length_on: float, length_off: float | None = None)¶
Intermittent weld pattern: weld for length_on, skip length_off, repeat with pitch centre-to-centre.
- class ada.LoadConceptAccelerationField(name: 'str', acceleration: 'tuple[float, float, float]', include_self_weight: 'bool' = True, rotational_field: 'RotationalAccelerationField' = None)¶
- class ada.LoadConceptCase(name: 'str', loads: 'list[LoadConceptLine | LoadConceptPoint | LoadConceptSurface | LoadConceptAccelerationField]' = <factory>, design_condition: 'DesignCondition' = <DesignCondition.OPERATING: 'operating'>, fem_loadcase_number: 'int' = 1, complex_type: "Literal['static']" = 'static', invalidated: 'bool' = True, include_self_weight: 'bool' = False, mesh_loads_as_mass: 'bool' = False)¶
- class ada.LoadConceptCaseCombination(name: 'str', load_cases: 'list[LoadConceptCaseFactored]', design_condition: "DesignCondition | Literal['operating']" = <DesignCondition.OPERATING: 'operating'>, complex_type: "Literal['static']" = 'static', invalidated: 'bool' = True, convert_load_to_mass: 'bool' = False, global_scale_factor: 'float' = 1.0, equipments_type: "Literal['line_load']" = 'line_load')¶
- class ada.LoadConceptCaseFactored(load_case: 'LoadConceptCase', factor: 'float', phase: 'int' = 0)¶
- class ada.LoadConceptLine(name: 'str', start_point: 'Point | Iterable', end_point: 'Point | Iterable', intensity_start: 'tuple[float, float, float]', intensity_end: 'tuple[float, float, float]', system: "Literal['local', 'global']" = 'local')¶
- class ada.LoadConceptPoint(name: 'str', position: 'Point | Iterable', force: 'tuple[float, float, float]', moment: 'tuple[float, float, float]', system: "Literal['local', 'global']" = 'local')¶
- class ada.LoadConceptSurface(name: 'str', plate_ref: 'Plate' = None, points: 'list[Iterable]' = None, pressure: 'float' = None, side: "Literal['front', 'back']" = 'front', system: "Literal['local', 'global']" = 'local')¶
- class ada.MassPoint(name: str, p: Point | Iterable[numeric, numeric, numeric], mass: float, radius=0.2, placement: Placement = None)¶
Concept mass point object, added to handle export to genie xml without needing to use fem-object
- class ada.Material(name, mat_model: Metal | CarbonSteel = None, mat_id=None, parent=None, metadata=None, units=Units.M, guid=None, ifc_store: IfcStore = None)¶
The base material class. Currently only supports Metals. Default material model is S355 carbon steel
- class ada.Node(p: Iterable[numeric, numeric, numeric] | Point, nid=None, r=None, parent=None, units=Units.M, refs=None)¶
Base node object
- Parameters:
p – 3D coordinates of the node
nid – node id
bc – boundary condition of the node
- property has_refs: bool¶
Returns if node is valid, i.e. has objects in refs
- class ada.Part(name, color=None, placement=None, fem: FEM = None, metadata=None, parent=None, units: Units = Units.M, guid=None, ifc_store: IfcStore = None, ifc_class: SpatialTypes = SpatialTypes.IfcBuildingStorey)¶
A Part superclass design to host all relevant information for cad and FEM modelling.
- IFC_CLASSES¶
alias of
SpatialTypes
- add_joint(joint: JointBase) JointBase¶
This method takes a Joint element containing two intersecting beams. It will check with the existing list of joints to see whether or not it is part of a larger more complex joint. It usese primarily two criteria.
Criteria 1: If both elements are in an existing joint already, it will u
Criteria 2: If the intersecting point coincides within a specified tolerance (currently 10mm) with an exisiting joint intersecting point. If so it will add the elements to this joint. If not it will create a new joint based on these two members.
- add_materials_in_batch(mats: Iterable[Material]) dict[Material, Material]¶
Add each unique material exactly once. Returns a map original_material -> container_material.
- add_objects_in_batch(objects: Iterable[Beam | Plate], add_to_layer: str = None) list[Beam | Plate]¶
Batch-add beams and plates. Returns the list of added (or existing) objects. Only supports Beam/BeamTapered and Plate for now.
- add_sections_in_batch(secs: Iterable[Section]) dict[Section, Section]¶
Add each unique section exactly once. Returns a map original_section -> container_section.
- beam_clash_check(margins=5e-05)¶
For all beams in a Assembly get all beams touching or within the beam. Essentially a clash check is performed and it returns a dictionary of all beam ids and the touching beams. A margin to the beam volume can be included.
- Parameters:
margins – Add margins to the volume box (equal in all directions). Input is in meters. Can be negative.
- Returns:
A map generator for the list of beams and resulting intersecting beams
- property concept_fem: ConceptFEM¶
Returns the ConceptFEM object associated with this Part.
- consolidate_sections(include_self=True)¶
Moves all sections from all sub-parts to this part
- copy_to(name: str = None, position: list[float] | Point = None, rotation_axis: Iterable[float] = None, rotation_angle: float = None, add_object_copy_suffix: bool = True) Part¶
Copy the part and all its sub_parts to a new part. Optionally add translation and/or rotation to the new part
- create_objects_from_fem(skip_plates=False, skip_beams=False, merge=False, reconstruct_surfaces=False) None¶
Build Beams and Plates from the contents of the local FEM object.
mergefolds the one-object-per-element output back down by merging coplanar shell plates (same material + thickness) and colinear beams (same section + material). Best-effort: a group is merged only when it collapses cleanly, else its elements are kept. Defaults off here to keep the 1:1 element→object mapping callers expect; the FEM→CAD conversion path opts in (merge_fem_objects).reconstruct_surfaces(opt-in) instead recovers smooth structured quad panels as single curved plates (NURBS B-rep) — a large size/time reduction for CAD export of meshes generated from curved panels. Non-reconstructable elements fall back to flat plates (coplanar-merged whenmergeis on). Beams are unaffected.
- get_all_welds() Iterable[Weld]¶
Single source of truth for iterating welds across the part tree.
Welds live in
Part._welds— a container intentionally separate fromget_all_physical_objectsbecause the IFC / FEM / GXML writers can’t process them (no .material, nosolid_geomuntil the Weld.solid_geom delegation, etc.). The GLB pipeline composes both iterators explicitly: tessellation + GraphStore add welds via this method on top of the physical objects. Avoids scatteringinclude_welds=Falseopt-outs across every non-GLB caller.
- get_by_name(name) Part | Plate | Beam | Shape | Material | Pipe | None¶
Get element of any type by its name.
- iter_objects_from_fem(beams: bool = True, plates: bool = True, detached: bool = True, mat_cache: dict | None = None, merge_strategy=None) Iterable[Beam | Plate]¶
Lazily build concept objects from this part’s FEM mesh.
Streaming sibling of
create_objects_from_fem(): yields one object at a time WITHOUT materialising the full set or adding them to the part’s containers, so a streaming exporter (e.g.Assembly.to_ifc(streaming=True)) keeps peak memory bounded. Beams are yielded before plates.detached(default) yields transient plates carrying no material back-reference, so each frees as soon as the consumer drops it.merge_strategyselects how shells fold into plates:None(default) keeps the legacy 1:1 element→plate mapping; any strategy value ("coplanar"/…) sources plates from the object-free vectorized face engine (ada.fem.formats.mesh_faces.faces_from_fem()) and wraps each merged face in a single transientPlate. This is the one place the merge strategy lives, so every streaming consumer (Genie XML, IFC, STEP) folds shells the same way. Beams are unaffected (they fold via the colinear pass on the object create path; the strategy is shell-only).mat_cache(name →Material) lets the caller pin which material objects the plates reference — pass the already-consolidated materials so the streamed plates share the exporter’s material identity (else a post-consolidationmaterials.addwould mint a fresh copy).
- read_step_file(step_path, name=None, scale=None, transform=None, rotate=None, colour=None, opacity=1.0, source_units=Units.M, include_shells=False, reader: str = 'occ')¶
- Parameters:
step_path – Can be path to stp file or path to directory of step files.
name – Desired name of destination Shape object
scale – Scale the step content upon import
transform – Transform the step content upon import
rotate – Rotate step content upon import
colour – Assign a specific colour upon import
opacity – Assign Opacity upon import
source_units – Unit of the imported STEP file. Default is ‘m’
reader – “occ” (default) reads via the OpenCASCADE STEPControl_Reader. “stream” uses the kernel-free streaming reader (constant-memory parse, yields adapy geometry directly — see ada.cadit.step.read.stream_reader); “auto” tries the streaming reader first and falls back to OCC if the file uses any entity outside its scope; “tolerant” reads every supported solid kernel-free and skips the unsupported ones (no whole-file OCC fallback) — best for large mixed CAD that would OOM the OCC reader.
- render_offscreen(camera: Camera | None = None, *, backend: Literal['pygfx', 'chromium'] = 'pygfx', preset: dict | None = None, size: tuple[int, int] = (640, 480)) Image¶
Render the part to a PIL Image.
Parameters¶
- camera
Legacy pygfx camera. When supplied with
backend="pygfx", the trimesh-scene render path is used (kept for callers that already pass a hand-builtCamera). WhenNone, both backends route through the embed’sapplyCameraPresetmath so pygfx, chromium, and the live 3D viewer all use identical camera setup.- backend
"pygfx"(default) — fast offscreen render via wgpu."chromium"drives the production adapy embed in headless Chromium via Playwright.camerais ignored by chromium; passpresetto override the embed’sCameraPreset.- preset
Camera preset dict (azimuth_deg, elevation_deg, fov_deg, distance, margin, …). Honored by both backends when
camerais None — same field names asparadoc.camera.presets.CameraPresetso the three render paths read from a single source of truth.- size
Viewport size (also the output PNG size at DPR=1).
- to_trimesh_scene(render_override: dict[str, GeomRepr | str] = None, filter_by_guids=None, merge_meshes=True, stream_from_ifc=False, params: RenderParams = None, include_ada_ext: bool = False) trimesh.Scene¶
Create a Trimesh.Scene from ada.Part.
- property welds: list[Weld]¶
Welds at or below the topmost ancestor that include this object as a member.
Walks to the root of the parent chain (Assembly, Part, or standalone Connection) rather than insisting on an Assembly specifically — a standalone Connection used for previews has no Assembly parent but still owns welds in its _welds list.
- class ada.Pipe(name, points, sec, mat='S355', content=None, metadata=None, color=None, units: Units = Units.M, guid=None, place: Placement = None)¶
- class ada.PipeSegElbow(name, start, midpoint, end, bend_radius, section, material=None, parent=None, guid=None, metadata=None, units=Units.M, color=None, arc_seg=None)¶
- line_occ()¶
Wire/edge body as an opaque CAD
ShapeHandle(seesolid_occ()for the handle contract).
- shell_occ()¶
Shell/face body as an opaque CAD
ShapeHandle(seesolid_occ()for the handle contract).
- solid_occ()¶
Solid body for this object as an opaque CAD
ShapeHandle.The handle is the cross-subsystem lingua franca (tessellation, IFC, clash, bbox, FEM all consume it). Treat it as opaque — its concrete type is backend-private (a
TopoDS_Solid/TopoDS_Compoundunder the default OCC backend). Operate on it via the CAD backend verbs, not by importing kernel types. See dap plan/v3 notes_occ_backend_abstraction (Phase 2).
- class ada.PipeSegStraight(name, p1, p2, section, material, parent=None, guid=None, metadata=None, units=Units.M, color=None)¶
- line_occ()¶
Wire/edge body as an opaque CAD
ShapeHandle(seesolid_occ()for the handle contract).
- shell_occ()¶
Shell/face body as an opaque CAD
ShapeHandle(seesolid_occ()for the handle contract).
- solid_occ()¶
Solid body for this object as an opaque CAD
ShapeHandle.The handle is the cross-subsystem lingua franca (tessellation, IFC, clash, bbox, FEM all consume it). Treat it as opaque — its concrete type is backend-private (a
TopoDS_Solid/TopoDS_Compoundunder the default OCC backend). Operate on it via the CAD backend verbs, not by importing kernel types. See dap plan/v3 notes_occ_backend_abstraction (Phase 2).
- class ada.Plate(name: str, points: CurvePoly2d | CoordinateSequence, t: float, mat: str | Material = 'S420', origin: Iterable | Point = None, xdir: Iterable | Direction = None, normal: Iterable | Direction = None, orientation: Placement = None, pl_id=None, tol=None, detached: bool = False, **kwargs)¶
A plate object. The plate element covers all plate elements.
Contains a dictionary with each point of the plate described by an id (index) and a Node object.
- Parameters:
name – Name of plate
points – List of 2D point coordinates (or a PolyCurve) that make up the plate. Each point is (x, y, optional [radius])
t – Thickness of plate
mat – Material. Can be either Material object or built-in materials (‘S420’ or ‘S355’)
origin – Explicitly define origin of plate. If not set
xdir – Explicitly define x direction of plate. If not set
normal – Explicitly define normal direction of plate. If not set
- bbox() BoundingBox¶
Bounding Box of plate
- static from_fem_shell(name, points, t, mat='S420', color=None, metadata=None, parent=None, detached=False, **kwargs) Plate¶
Fast Plate constructor for flat FEM shell elements (no arcs/radii).
Equivalent geometry to
from_3d_pointsbut routed throughCurvePoly2d.from_fem_shell, which skipsbuild_polycurveand the computed-placement LRU. SeeCurvePoly2d.from_fem_shell().detachedyields a transient plate (no material back-reference) for streaming exporters that build, emit and discard it — seeada.Part.iter_objects_from_fem().
- get_cog() Point¶
Plate centroid in global coordinates.
Convention: - poly.points2d are expressed in the plate’s 2D local system (X,Y). - poly.origin is the local 3D origin of that 2D system. - poly.xdir defines local X direction in 3D. - poly.normal defines local Z (plane normal) in 3D. - local Y is constructed as (normal × xdir) to enforce right-hand rule.
If plate has a non-identity placement, we: - rotate xdir and normal by placement rotation - translate origin by placement translation (origin = place_abs.origin + poly.origin)
- line_occ()¶
Wire/edge body as an opaque CAD
ShapeHandle(seesolid_occ()for the handle contract).
- shell_occ()¶
Shell/face body as an opaque CAD
ShapeHandle(seesolid_occ()for the handle contract).
- solid_occ() ShapeHandle¶
Solid body for this object as an opaque CAD
ShapeHandle.The handle is the cross-subsystem lingua franca (tessellation, IFC, clash, bbox, FEM all consume it). Treat it as opaque — its concrete type is backend-private (a
TopoDS_Solid/TopoDS_Compoundunder the default OCC backend). Operate on it via the CAD backend verbs, not by importing kernel types. See dap plan/v3 notes_occ_backend_abstraction (Phase 2).
- property t: float¶
Plate thickness
- class ada.PlateCurved(name, face_geom: Geometry, t: float, mat: str | Material = 'S420', extrude_as_solid: bool = False, **kwargs)¶
Plate built on a non-planar face (typically a B-spline patch).
Used by readers that surface a curved surface — the gxml importer for advanced SAT faces, and the loft tool for ruled corner- transition surfaces between sharp and rounded profiles. Carries the underlying
Geometrydirectly; rendering paths convert it viaada.occ.geom.geom_to_occ_geom()and the GLB tessellator’s PlateCurved branch.Quacks like
Platefor the parts of the Part-attachment contract thatadd_plateexercises: exposesnodes(derived from the face’s outer wire), accepts a same-valueunitsre-assignment, and inheritschange_typefromRoot. Cross-unit conversion isn’t implemented yet — set the right units before constructing the plate.- extruded_solid_occ() ShapeHandle¶
Prism-extrude the curved face by
talong its normal so the rendered plate carries thickness like a planarPlate.from_3d_pointsdoes.Returns a backend
ShapeHandle(Solid) ready for the tessellator. Falls back to the bare face shape on any prism failure so the caller still gets something to render.
- classmethod from_occ_face(name: str, occ_face, t: float, mat: str | Material = 'S420', **kwargs) PlateCurved¶
Construct a PlateCurved from a raw OCC
TopoDS_Face.Bypasses the
Geometry→AdvancedFaceround-trip that the regular__init__path relies on. The loft tool uses this when it already has the OCC face fromBRepOffsetAPI_ThruSections— going via AdvancedFace would only re-decode the same surface back into OCC, and theocc_face_to_ada_face→make_face_from_geomround-trip currently has a bounds-structure mismatch (the STEP reader emits raw curve types asAdvancedFace.boundswhile the OCC builder expectsFaceBoundwrappers around ``EdgeLoop``s).Behaviour:
solid_occreturns the wrapped face directly;extruded_solid_occextrudes it along its normal;nodeswalks the face’s outer wire. Thegeom/solid_geomaccessors returnNone— callers that need an adapyGeometrymust use the__init__constructor instead.
- property nodes: list[Node]¶
Boundary nodes from the outer wire of the wrapped face.
Part.add_plateregisters these into the parent Part’s node container so the curved plate participates in node-based lookups (selection, FEM mesh anchors) the same way a planarPlate.nodeswould. Cached on first access; the underlying geometry isn’t expected to mutate post-construction.Falls back to an empty list when the geometry can’t be converted to an OCC face — the gxml importer flags some advanced faces with a flat-fallback path, and we’d rather let the plate attach with zero boundary nodes than blow up the caller.
- solid_occ() ShapeHandle¶
Solid body for this object as an opaque CAD
ShapeHandle.The handle is the cross-subsystem lingua franca (tessellation, IFC, clash, bbox, FEM all consume it). Treat it as opaque — its concrete type is backend-private (a
TopoDS_Solid/TopoDS_Compoundunder the default OCC backend). Operate on it via the CAD backend verbs, not by importing kernel types. See dap plan/v3 notes_occ_backend_abstraction (Phase 2).
- class ada.Point(*coords: float | int | Iterable[float | int])¶
- class ada.PrimBox(name, p1, p2, origin=None, placement=None, material: Material | Literal['S355', 'S420'] = None, **kwargs)¶
Primitive Box. Length, width & height are local x, y and z respectively
- copy_to(name: str = None, position: list[float] | Point = None, rotation_axis: Iterable[float] = None, rotation_angle: float = None) PrimBox¶
Copy the box to a new position and/or rotation.
- solid_occ()¶
Solid body for this object as an opaque CAD
ShapeHandle.The handle is the cross-subsystem lingua franca (tessellation, IFC, clash, bbox, FEM all consume it). Treat it as opaque — its concrete type is backend-private (a
TopoDS_Solid/TopoDS_Compoundunder the default OCC backend). Operate on it via the CAD backend verbs, not by importing kernel types. See dap plan/v3 notes_occ_backend_abstraction (Phase 2).
- class ada.PrimCone(name, p1, p2, r, **kwargs)¶
- solid_occ() ShapeHandle¶
Solid body for this object as an opaque CAD
ShapeHandle.The handle is the cross-subsystem lingua franca (tessellation, IFC, clash, bbox, FEM all consume it). Treat it as opaque — its concrete type is backend-private (a
TopoDS_Solid/TopoDS_Compoundunder the default OCC backend). Operate on it via the CAD backend verbs, not by importing kernel types. See dap plan/v3 notes_occ_backend_abstraction (Phase 2).
- class ada.PrimCyl(name, p1, p2, r, **kwargs)¶
- solid_occ() ShapeHandle¶
Solid body for this object as an opaque CAD
ShapeHandle.The handle is the cross-subsystem lingua franca (tessellation, IFC, clash, bbox, FEM all consume it). Treat it as opaque — its concrete type is backend-private (a
TopoDS_Solid/TopoDS_Compoundunder the default OCC backend). Operate on it via the CAD backend verbs, not by importing kernel types. See dap plan/v3 notes_occ_backend_abstraction (Phase 2).
- class ada.PrimExtrude(name, curve2d: list[tuple], h, normal=None, origin=None, xdir=None, tol=0.001, **kwargs)¶
- solid_occ() ShapeHandle¶
Solid body for this object as an opaque CAD
ShapeHandle.The handle is the cross-subsystem lingua franca (tessellation, IFC, clash, bbox, FEM all consume it). Treat it as opaque — its concrete type is backend-private (a
TopoDS_Solid/TopoDS_Compoundunder the default OCC backend). Operate on it via the CAD backend verbs, not by importing kernel types. See dap plan/v3 notes_occ_backend_abstraction (Phase 2).
- class ada.PrimRevolve(name, points, rev_angle, origin=None, xdir=None, normal=None, tol=0.001, **kwargs)¶
Revolved Primitive
- property revolve_angle: float¶
Revolve angle in degrees
- solid_occ() ShapeHandle¶
Solid body for this object as an opaque CAD
ShapeHandle.The handle is the cross-subsystem lingua franca (tessellation, IFC, clash, bbox, FEM all consume it). Treat it as opaque — its concrete type is backend-private (a
TopoDS_Solid/TopoDS_Compoundunder the default OCC backend). Operate on it via the CAD backend verbs, not by importing kernel types. See dap plan/v3 notes_occ_backend_abstraction (Phase 2).
- class ada.PrimSweep(name, sweep_curve: Iterable[Iterable[float]] | CurveOpen3d, profile_curve_outer: Iterable[Iterable[float]] | CurvePoly2d, profile_xdir=None, profile_normal=None, profile_ydir=None, origin=None, derived_reference=False, tol=0.001, radiis: dict[int, float] = None, **kwargs)¶
- class ada.RigidLinkRegion(lower_corner: 'Iterable | Point', upper_corner: 'Iterable | Point')¶
- class ada.RotationalAccelerationField(rotational_point: 'tuple[float, float, float] | Point', rotational_axis: 'tuple[float, float, float] | Direction', angular_acceleration: 'float', angular_velocity: 'float')¶
- class ada.Shape(name, geom: Geometry | list[Geometry] | None = None, color=None, opacity=1.0, mass: float = None, cog: Iterable = None, material: Material | Literal['S355', 'S420'] = None, units=Units.M, metadata=None, guid=None, placement=None, ifc_store: IfcStore = None, ifc_class: ShapeTypes = ShapeTypes.IfcBuildingElementProxy, parent=None)¶
- IFC_CLASSES¶
alias of
ShapeTypes
- solid_occ() ShapeHandle¶
Solid body for this object as an opaque CAD
ShapeHandle.The handle is the cross-subsystem lingua franca (tessellation, IFC, clash, bbox, FEM all consume it). Treat it as opaque — its concrete type is backend-private (a
TopoDS_Solid/TopoDS_Compoundunder the default OCC backend). Operate on it via the CAD backend verbs, not by importing kernel types. See dap plan/v3 notes_occ_backend_abstraction (Phase 2).
- class ada.Surface(name: str, points: CurvePoly2d | CoordinateSequence, mat: str | Material = 'S420', origin: Iterable | Point = None, xdir: Iterable | Direction = None, normal: Iterable | Direction = None, orientation: Placement = None, pl_id=None, tol=None, **kwargs)¶
Planar surface —
Platewithout thickness.Same geometry contract as Plate (planar polygon bounded by a
CurvePoly2d) but rendered as a 2D face rather than an extruded prism. Useful for visualisation-only output or for pipelines that supply thickness separately (FEM shell elements where the thickness lives on the section, not the geometry).Subclasses Plate so every Plate-dispatching consumer (the GLB tessellator, IFC writer,
Part.add_plate, BoundingBox) picks it up automatically.solid_occis overridden to return the planar face shape instead of attempting a zero-thickness prism extrusion (which would otherwise crash inBRepPrimAPI_MakePrism).- solid_occ() ShapeHandle¶
Solid body for this object as an opaque CAD
ShapeHandle.The handle is the cross-subsystem lingua franca (tessellation, IFC, clash, bbox, FEM all consume it). Treat it as opaque — its concrete type is backend-private (a
TopoDS_Solid/TopoDS_Compoundunder the default OCC backend). Operate on it via the CAD backend verbs, not by importing kernel types. See dap plan/v3 notes_occ_backend_abstraction (Phase 2).
- class ada.SurfaceCurved(name: str, face_geom: Geometry, mat: str | Material = 'S420', **kwargs)¶
Non-planar surface —
PlateCurvedwithout thickness.Same underlying B-spline / advanced face data as PlateCurved but rendered as a 2D face. The PlateCurved render path already short-circuits to the bare face when
t == 0(inextruded_solid_occ), so subclassing with a forced zero thickness is the entire change.- classmethod from_occ_face(name: str, occ_face, mat: str | Material = 'S420', **kwargs) SurfaceCurved¶
Construct a thickness-less curved surface from a raw OCC face.
Mirrors
PlateCurved.from_occ_face()but pins thickness to zero so downstream rendering emits the bare face.
- class ada.Transform(translation: 'np.ndarray' = None, rotation: 'Rotation' = None)¶
- class ada.Units(*values)¶
- class ada.User(user_id: str = 'AdaUser', given_name: str = None, family_name: str = None, middle_names: str = None, prefix_titles: str = None, suffix_titles: str = None, org_id: str = 'ADA', org_name: str = 'Assembly For Design and Analysis', org_description: str = None, role: str = 'Engineer')¶
- class ada.Wall(name, points, height, thickness, placement=None, offset='CENTER', metadata=None, color=None, units=Units.M, guid=None, opacity=1.0)¶
- TYPES_JUSL¶
alias of
WallJustification
- shell_occ()¶
Shell/face body as an opaque CAD
ShapeHandle(seesolid_occ()for the handle contract).
- solid_occ()¶
Solid body for this object as an opaque CAD
ShapeHandle.The handle is the cross-subsystem lingua franca (tessellation, IFC, clash, bbox, FEM all consume it). Treat it as opaque — its concrete type is backend-private (a
TopoDS_Solid/TopoDS_Compoundunder the default OCC backend). Operate on it via the CAD backend verbs, not by importing kernel types. See dap plan/v3 notes_occ_backend_abstraction (Phase 2).
- class ada.Weld(name, p1=None, p2=None, weld_type: WeldType | str = WeldType.FILLET, members=(), profile: list[tuple] | None = None, xdir: tuple | None = None, groove: list[tuple] | None = None, parent=None, *, throat: float | None = None, leg1: float | None = None, leg2: float | None = None, groove_angle: float | None = None, root_gap: float | None = None, root_face: float | None = None, sided: Literal['one', 'two'] = 'one', intermittent: IntermittentSpec | None = None, sweep_curve: CurveOpen3d | Any | None = None, profile_normal: tuple | None = None, profile_ydir: tuple | None = None)¶
First-class weld object.
Geometric placement is always required:
p1/p2(linear extrude) orsweep_curve(curved sweep).xdiris also required — it orients the profile cross-section in 3D, which member geometry alone cannot disambiguate (a fillet between the same members has two valid fill sides).The profile is either supplied explicitly (
profile=) or derived from parametric inputs (weld_type + throatand optionallyleg1/2/groove_angle/root_gap/root_face) viabuild_profile.
- class ada.WeldType(*values)¶
Weld type catalog mirroring the 27-value set from upstream weld libraries.
Names are stripped of the
WELD_TYPE_prefix; values match the names. from_str accepts both stripped and prefixed forms case- insensitively.
- ada.deprecated(reason: str)¶
A decorator to mark functions or classes as deprecated. Emits a warning when the function or class is used, including the module path.
- Parameters:
reason – Explanation of why the function/class is deprecated.
- ada.from_acis(sat_file: str | Path, source_units=Units.M, split: bool = False, limit: int = None) Assembly¶
Create an Assembly object from an ACIS SAT file.
- Args:
sat_file: Path to ACIS SAT file source_units: Units of the SAT file split: If True, split shells into individual AdvancedFace objects limit: Limit the number of geometries to export (useful for debugging)
- Returns:
Assembly object with parsed geometry
- ada.from_fem(fem_file: str | list | Path, fem_format: str | list = None, name: str | list = None, source_units=Units.M, fem_converter='default', create_concept_objects=False, convert_skip_plates=False, convert_skip_beams=False) Assembly¶
Create an Assembly object from a FEM file.
- ada.from_genie_xml(xml_path, ifc_schema='IFC4', name: str = None, extract_joints=False) Assembly¶
Create an Assembly object from a Genie XML file.