A zero-dependency IFC STEP parser and BIM extraction engine for MoonBit
///|
let model = @ifc.parse(step_text)
///|
let products = model.products()
///|
let browser_payload = @ifc.model_to_json(model)pub suberror ParseError {
UnexpectedEnd(position~ : SourcePosition)
UnexpectedCharacter(position~ : SourcePosition, character~ : Char)
Expected(position~ : SourcePosition, token~ : String)
InvalidNumber(position~ : SourcePosition, text~ : String)
InvalidReference(position~ : SourcePosition, text~ : String)
InvalidEntity(position~ : SourcePosition, text~ : String)
InvalidHeader(position~ : SourcePosition, text~ : String)
UnsupportedFile(text~ : String)
} derive(Debug)pub(all) struct AssetManifest {
schema : String
model_hash : Int
entries : Array[AssetManifestEntry]
product_count : Int
chunk_count : Int
point_count : Int
triangle_count : Int
bounds : BoundingBox
} derive(Debug)fn AssetManifest::entries_of_kind(self : AssetManifest, kind : AssetKind) -> Array[AssetManifestEntry]pub(all) struct AssetManifestEntry {
path : String
kind : AssetKind
product_ids : Array[Int]
byte_length : Int
point_count : Int
triangle_count : Int
bounds : BoundingBox
checksum : Int
compressed : Bool
} derive(Debug)pub(all) struct AssetManifestOptions {
base_uri : String
chunk_size : Int
include_properties : Bool
include_spatial : Bool
include_product_rows : Bool
include_empty_chunks : Bool
} derive(Debug)fn AssetManifestOptions::including_empty_chunks(self : AssetManifestOptions, value : Bool) -> AssetManifestOptionsfn AssetManifestOptions::including_product_rows(self : AssetManifestOptions, value : Bool) -> AssetManifestOptionsfn AssetManifestOptions::including_properties(self : AssetManifestOptions, value : Bool) -> AssetManifestOptionsfn AssetManifestOptions::including_spatial(self : AssetManifestOptions, value : Bool) -> AssetManifestOptionsfn AssetManifestOptions::with_base_uri(self : AssetManifestOptions, base_uri : String) -> AssetManifestOptionsfn AssetManifestOptions::with_chunk_size(self : AssetManifestOptions, chunk_size : Int) -> AssetManifestOptionspub(all) struct BenchmarkCase {
name : String
iterations : Int
source_length : Int
entity_count : Int
} derive(Debug)pub(all) struct BenchmarkReport {
toolchain : String
cases : Array[BenchmarkResult]
notes : Array[String]
} derive(Debug)pub(all) struct BenchmarkResult {
name : String
iterations : Int
elapsed_millis : UInt64
operations_per_second : Double
source_length : Int
entity_count : Int
allocated_entities : Int
} derive(Debug)pub(all) struct BimScene {
items : Array[SceneItem]
roots : Array[SpatialNode]
bounds : BoundingBox
} derive(Debug)pub(all) struct CanonicalStepStats {
source_length : Int
canonical_length : Int
entity_count : Int
changed : Bool
duplicate_id_count : Int
line_count : Int
} derive(Debug)pub(all) struct CapabilityReport {
schema : SchemaVersion
has_products : Bool
has_spatial_structure : Bool
has_properties : Bool
has_geometry : Bool
has_units : Bool
} derive(Debug)pub(all) struct CatalogQuery {
kind : ProductKind?
ifc_type : String?
name_contains : String?
property_contains : String?
container : Int?
sort_key : CatalogSortKey
direction : SortDirection
offset : Int
limit : Int
} derive(Debug)fn CatalogQuery::sorted_by(self : CatalogQuery, sort_key : CatalogSortKey, direction : SortDirection) -> CatalogQuerypub(all) struct ClashPair {
left : SpatialEntry
right : SpatialEntry
relation : BoxRelation
overlap : BoundingBox
overlap_volume : Double
clearance : Double
} derive(Debug)fn ClashReport::pairs_for_type(self : ClashReport, left_type : String, right_type : String) -> Array[ClashPair]pub(all) struct ClassificationReference {
entity_id : Int
source : String?
identification : String?
name : String?
referenced_entity : Int
} derive(Debug)pub(all) struct CoordinateFrame {
entity_id : Int
name : String
parent_id : Int?
transform : Transform3
depth : Int
} derive(Debug)pub(all) struct CoordinateReport {
frames : Array[CoordinateFrame]
world_bounds : BoundingBox
unit_scale : Double
has_map_conversion : Bool
warning_count : Int
} derive(Debug)pub(all) struct DeliveryAssetChange {
path : String
change : DeliveryChange
before_checksum : Int?
after_checksum : Int?
affected_products : Array[Int]
byte_delta : Int
} derive(Debug)pub(all) struct Diagnostic {
severity : DiagnosticSeverity
code : String
message : String
entity_id : Int?
} derive(Debug)pub(all) struct EntityFieldChange {
entity_id : Int
attribute : Int
before : Value?
after : Value?
kind : ChangeKind
} derive(Debug)pub(all) struct EntityRange {
first_id : Int
last_id : Int
entity_count : Int
contiguous : Bool
} derive(Debug)pub(all) struct ExportBundle {
headline : String
json : String
products_csv : String
properties_csv : String
scene_json : String
} derive(Debug)pub(all) struct ExportOptions {
format : ExportFormat
include_empty_products : Bool
include_normals : Bool
include_properties : Bool
precision : Int
} derive(Debug)pub(all) struct ExportedAsset {
format : ExportFormat
file_name : String
content : String
product_count : Int
point_count : Int
triangle_count : Int
} derive(Debug)pub(all) struct FormulaTakeoff {
rows : Array[ProductTakeoff]
notes : Array[QuantityNote]
formulas : Array[QuantityFormula]
product_count : Int
missing_formula_count : Int
} derive(Debug)fn FormulaTakeoff::quantity(self : FormulaTakeoff, product_id : Int, kind : QuantityKind) -> QuantityValue?pub(all) struct Geometry {
source_id : Int
kind : GeometryKind
points : Array[Point3]
references : Array[Int]
depth : Double?
profile_width : Double?
profile_height : Double?
profile_radius : Double?
face_count : Int
triangle_count : Int
} derive(Debug)pub(all) struct GeometryInventory {
products : Array[ProductGeometryReport]
represented_product_count : Int
empty_representation_count : Int
invalid_mesh_count : Int
total_surface_area : Double
total_volume : Double
} derive(Debug)pub(all) struct GraphDegree {
id : Int
incoming : Int
outgoing : Int
total : Int
orphan : Bool
} derive(Debug)pub(all) struct GraphStats {
entity_count : Int
reference_count : Int
distinct_targets : Int
max_out_degree : Int
orphan_reference_count : Int
} derive(Debug)pub(all) struct GuidReport {
value : String
valid : Bool
decoded_bytes : Int
normalized : String
message : String
} derive(Debug)pub(all) struct Inspection {
model : Model
summary : ModelSummary
metrics : ModelMetrics
validation : ValidationReport
capabilities : CapabilityReport
} derive(Debug)pub(all) struct ManifestNode {
product_id : Int
ifc_type : String
name : String?
kind : ProductKind
property_names : Array[String]
geometry_count : Int
bounds : BoundingBox
} derive(Debug)pub(all) struct MaterialAssignment {
product_id : Int
association_id : Int
material_id : Int?
material_name : String?
layers : Array[MaterialLayer]
constituents : Array[String]
} derive(Debug)pub(all) struct MaterialInventory {
assignments : Array[MaterialAssignment]
distinct_materials : Array[String]
layered_product_count : Int
unassigned_product_count : Int
} derive(Debug)pub(all) struct MaterialLayer {
entity_id : Int
material_id : Int?
material_name : String?
thickness : Double?
priority : Int?
is_unbounded : Bool
} derive(Debug)pub(all) struct MeshIssue {
code : String
message : String
point_index : Int?
triangle_index : Int?
} derive(Debug)pub(all) struct MeshPipelineOptions {
weld_tolerance : Double
degenerate_tolerance : Double
maximum_triangles : Int
recenter : Bool
scale : Double
flip_winding : Bool
generate_normals : Bool
compact_vertices : Bool
} derive(Debug)fn MeshPipelineOptions::with_degenerate_tolerance(self : MeshPipelineOptions, value : Double) -> MeshPipelineOptionsfn MeshPipelineOptions::with_maximum_triangles(self : MeshPipelineOptions, value : Int) -> MeshPipelineOptionsfn MeshPipelineOptions::with_normals(self : MeshPipelineOptions, value : Bool) -> MeshPipelineOptionsfn MeshPipelineOptions::with_weld_tolerance(self : MeshPipelineOptions, value : Double) -> MeshPipelineOptionspub(all) struct MeshPipelineResult {
mesh : Mesh
normals : Array[Vector3]
stats : MeshPipelineStats
} derive(Debug)pub(all) struct MeshPipelineStats {
input_points : Int
input_triangles : Int
output_points : Int
output_triangles : Int
removed_points : Int
removed_triangles : Int
surface_area : Double
volume : Double
bounds : BoundingBox
valid : Bool
} derive(Debug)pub(all) struct MeshStats {
point_count : Int
triangle_count : Int
boundary_edge_count : Int
non_manifold_edge_count : Int
degenerate_triangle_count : Int
connected_component_count : Int
surface_area : Double
signed_volume : Double
} derive(Debug)pub(all) struct ModelCatalog {
model : Model
index : ModelIndex
products : Array[Product]
property_sets : Array[PropertySet]
roots : Array[SpatialNode]
metrics : ModelMetrics
type_counts : Map[String, Int]
} derive(Debug)fn ModelCatalog::property(self : ModelCatalog, product : Product, name : String) -> Property? raise ParseErrorfn ModelCatalog::property_sets_for(self : ModelCatalog, product : Product) -> Array[PropertySet] raise ParseErrorfn ModelCatalog::query_all(self : ModelCatalog, query : CatalogQuery) -> Array[Product] raise ParseErrorpub(all) struct ModelChange {
kind : ChangeKind
entity_id : Int
before : Entity?
after : Entity?
} derive(Debug)pub(all) struct ModelDeliveryReport {
source_length : Int
profile : ModelProfile
quality : ModelQualityReport
manifest : AssetManifest
canonical : CanonicalStepStats
} derive(Debug)pub(all) struct ModelDiff {
changes : Array[ModelChange]
added : Int
removed : Int
modified : Int
} derive(Debug)pub(all) struct ModelMetrics {
source_length : Int
entity_count : Int
product_count : Int
relationship_count : Int
geometry_count : Int
property_count : Int
spatial_depth : Int
reference_count : Int
} derive(Debug)pub(all) struct ModelPatch {
operations : Array[EntityPatch]
added : Int
removed : Int
replaced : Int
changed_attributes : Int
} derive(Debug)pub(all) struct ModelProfile {
schema : SchemaVersion
entity_count : Int
product_count : Int
family_counts : Map[String, Int]
type_counts : Map[String, Int]
known_entity_count : Int
unknown_entity_count : Int
relationship_count : Int
geometry_count : Int
property_set_count : Int
} derive(Debug)pub(all) struct ModelQualityReport {
findings : Array[QualityFinding]
score : Int
entity_count : Int
product_count : Int
orphan_count : Int
duplicate_id_count : Int
named_product_ratio : Double
guid_ratio : Double
unknown_entity_ratio : Double
} derive(Debug)fn ModelQualityReport::findings_at(self : ModelQualityReport, level : QualityLevel) -> Array[QualityFinding]pub(all) struct ModelRule {
code : String
description : String
severity : DiagnosticSeverity
entity_type : String?
minimum_arguments : Int?
required_attributes : Array[Int]
required_properties : Array[String]
minimum_value : Double?
maximum_value : Double?
} derive(Debug)fn ModelRule::new(code~ : String, description~ : String, severity? : DiagnosticSeverity) -> ModelRulefn ModelSlice::with_additional_roots(self : ModelSlice, ids : Array[Int], include_dependencies? : Bool) -> ModelSlicepub(all) struct ModelSummary {
schema : String
entity_count : Int
product_count : Int
property_set_count : Int
geometry_count : Int
spatial_count : Int
} derive(Debug)pub(all) struct ModelWorkspace {
model : Model
catalog : ModelCatalog
spatial : SpatialIndex
graph : GraphAnalysis
health : SourceHealth
quantities : TakeoffReport?
} derive(Debug)fn ModelWorkspace::query(self : ModelWorkspace, plan : ProductQueryPlan) -> ProductQueryPage raise ParseErrorfn ModelWorkspace::rules(self : ModelWorkspace, rules : Array[ModelRule]) -> RuleReport raise ParseErrorfn ModelWorkspace::takeoff(self : ModelWorkspace, options? : TakeoffOptions) -> TakeoffReport raise ParseErrorfn ModelWorkspace::with_quantities(self : ModelWorkspace, options? : TakeoffOptions) -> ModelWorkspace raise ParseErrorpub(all) struct NormalizedQuantity {
product_id : Int
kind : QuantityKind
value : Double
unit : String
source : String
estimated : Bool
recognized : Bool
} derive(Debug)pub(all) struct Product {
id : Int
ifc_type : String
kind : ProductKind
global_id : String?
name : String?
description : String?
object_type : String?
placement : Int?
representation : Int?
tag : String?
property_sets : Array[Int]
container : Int?
} derive(Debug)pub(all) enum ProductExpression {
MatchAll
MatchNone
Predicate(ProductPredicate)
Not(ProductExpression)
AllOf(Array[ProductExpression])
AnyOf(Array[ProductExpression])
} derive(Debug)fn ProductExpression::and_(self : ProductExpression, other : ProductExpression) -> ProductExpressionpub(all) struct ProductGeometryReport {
product_id : Int
geometry_count : Int
mesh_count : Int
point_count : Int
triangle_count : Int
bounds : BoundingBox
surface_area : Double
volume : Double
estimated_volume : Bool
valid_mesh_count : Int
} derive(Debug)pub(all) enum ProductPredicate {
ProductKind(ProductKind)
EntityType(String)
EntityTypePrefix(String)
NameContains(String)
DescriptionContains(String)
GlobalId(String)
Tag(String)
InContainer(Int)
HasProperties
HasGeometry
PropertyExists(String)
PropertyText(String, String)
PropertyNumber(String, NumberComparison, Double, Double?)
IdRange(Int, Int)
GeometryKind(GeometryKind)
Quantity(QuantityKind, NumberComparison, Double, Double?)
} derive(Debug)pub(all) struct ProductQuery {
kind : ProductKind?
ifc_type : String?
name_contains : String?
container : Int?
has_properties : Bool
} derive(Debug)pub(all) struct ProductQueryPlan {
expression : ProductExpression
sort : ProductSort
descending : Bool
offset : Int
limit : Int
include_empty_geometry : Bool
} derive(Debug)fn ProductQueryPlan::execute(self : ProductQueryPlan, model : Model) -> ProductQueryPage raise ParseErrorfn ProductQueryPlan::including_empty_geometry(self : ProductQueryPlan, value : Bool) -> ProductQueryPlanfn ProductQueryPlan::sorted_by(self : ProductQueryPlan, sort : ProductSort, descending? : Bool) -> ProductQueryPlanfn ProductQueryPlan::where_(self : ProductQueryPlan, expression : ProductExpression) -> ProductQueryPlanfn ProductQueryPlan::where_predicate(self : ProductQueryPlan, predicate : ProductPredicate) -> ProductQueryPlanpub(all) enum ProductSort {
ById
ByType
ByName
ByKind
ByQuantity(QuantityKind)
ByDistance(Point3)
} derive(Debug)pub(all) struct ProductTakeoff {
product : Product
quantities : Array[QuantityValue]
geometry_count : Int
mesh_triangle_count : Int
bounds : BoundingBox
} derive(Debug)pub(all) struct PropertyColumn {
name : String
value_type : String
populated_count : Int
numeric_count : Int
distinct_count : Int
} derive(Debug)pub(all) struct PropertyTable {
columns : Array[PropertyColumn]
rows : Array[PropertyRow]
product_count : Int
missing_value_count : Int
} derive(Debug)fn PropertyTable::numeric_rows(self : PropertyTable, name : String, comparison : NumberComparison, expected : Double, upper? : Double?) -> Array[PropertyRow]fn PropertyTable::rows_with_value(self : PropertyTable, name : String, value : String) -> Array[PropertyRow]pub(all) struct QualityFinding {
code : String
level : QualityLevel
message : String
entity_id : Int?
measured : Double
threshold : Double
repair_hint : String
} derive(Debug)pub(all) struct QualityPolicy {
maximum_orphans : Int
minimum_named_product_ratio : Double
minimum_guid_ratio : Double
maximum_duplicate_ids : Int
maximum_unknown_entity_ratio : Double
require_units : Bool
require_spatial_structure : Bool
require_geometry_for_products : Bool
} derive(Debug)fn QualityPolicy::requiring_spatial_structure(self : QualityPolicy, required : Bool) -> QualityPolicyfn QualityPolicy::with_guid_ratio(self : QualityPolicy, minimum_guid_ratio : Double) -> QualityPolicyfn QualityPolicy::with_name_ratio(self : QualityPolicy, minimum_named_product_ratio : Double) -> QualityPolicyfn QualityPolicy::with_unknown_ratio(self : QualityPolicy, maximum_unknown_entity_ratio : Double) -> QualityPolicypub(all) struct QuantityFormula {
kind : QuantityKind
property_names : Array[String]
fallback_to_geometry : Bool
multiplier : Double
unit : String
} derive(Debug)fn QuantityFormula::from_properties(self : QuantityFormula, names : Array[String]) -> QuantityFormulapub(all) struct QuantityNote {
product_id : Int
kind : QuantityKind
message : String
severity : DiagnosticSeverity
} derive(Debug)pub(all) struct QuantityValue {
kind : QuantityKind
value : Double
unit : String
source : String
estimated : Bool
} derive(Debug)fn RelationIndex::products_without_container(self : RelationIndex, products : Array[Product]) -> Array[Int]fn RelationIndex::products_without_properties(self : RelationIndex, products : Array[Product]) -> Array[Int]pub(all) struct RenderManifest {
schema : String
nodes : Array[ManifestNode]
bounds : BoundingBox
} derive(Debug)pub(all) struct RevisionDelivery {
before_hash : Int
after_hash : Int
changes : Array[DeliveryAssetChange]
affected_products : Array[Int]
invalidated_count : Int
retained_count : Int
added_count : Int
removed_count : Int
bytes_added : Int
bytes_removed : Int
} derive(Debug)pub(all) struct RuleReport {
rules : Array[ModelRule]
violations : Array[RuleViolation]
error_count : Int
warning_count : Int
checked_entities : Int
checked_products : Int
} derive(Debug)pub(all) struct RuleViolation {
rule_code : String
severity : DiagnosticSeverity
entity_id : Int?
entity_type : String?
message : String
property_name : String?
} derive(Debug)pub(all) struct SceneCamera {
position : Point3
forward : Vector3
up : Vector3
near_distance : Double
far_distance : Double
vertical_fov : Double
aspect_ratio : Double
projection : SceneProjection
} derive(Debug)fn SceneCamera::with_clip(self : SceneCamera, near_distance : Double, far_distance : Double) -> SceneCamerafn SceneCamera::with_lens(self : SceneCamera, vertical_fov : Double, aspect_ratio : Double) -> SceneCamerapub(all) struct SceneChunk {
index : Int
product_ids : Array[Int]
bounds : BoundingBox
point_count : Int
triangle_count : Int
} derive(Debug)pub(all) struct SceneItem {
product : Product
geometries : Array[Geometry]
transform : Transform3
bounds : BoundingBox
} derive(Debug)pub(all) struct ScenePartition {
chunks : Array[SceneChunk]
bounds : BoundingBox
chunk_size : Int
product_count : Int
} derive(Debug)fn ScenePartition::chunks_at_point(self : ScenePartition, point : Point3, tolerance? : Double) -> Array[SceneChunk]fn ScenePartition::chunks_intersecting(self : ScenePartition, bounds : BoundingBox, tolerance? : Double) -> Array[SceneChunk]pub(all) struct SceneQueryOptions {
tolerance : Double
minimum_distance : Double
maximum_items : Int
full_detail_distance : Double
medium_detail_distance : Double
include_empty : Bool
include_back_facing : Bool
} derive(Debug)fn SceneQueryOptions::including_back_facing(self : SceneQueryOptions, include_back_facing : Bool) -> SceneQueryOptionsfn SceneQueryOptions::including_empty(self : SceneQueryOptions, include_empty : Bool) -> SceneQueryOptionsfn SceneQueryOptions::with_lod_distances(self : SceneQueryOptions, full_detail_distance : Double, medium_detail_distance : Double) -> SceneQueryOptionsfn SceneQueryOptions::with_maximum_items(self : SceneQueryOptions, maximum_items : Int) -> SceneQueryOptionsfn SceneQueryOptions::with_tolerance(self : SceneQueryOptions, tolerance : Double) -> SceneQueryOptionspub(all) struct SceneSelection {
items : Array[SceneVisibleItem]
tested_count : Int
culled_count : Int
full_count : Int
medium_count : Int
coarse_count : Int
bounds_only_count : Int
visible_bounds : BoundingBox
} derive(Debug)fn SceneSelection::from_index(index : SpatialIndex, camera : SceneCamera, options? : SceneQueryOptions) -> SceneSelectionpub(all) struct SceneVisibleItem {
product_id : Int
ifc_type : String
distance : Double
depth : Double
projected_radius : Double
lod : SceneLod
triangle_count : Int
bounds : BoundingBox
} derive(Debug)pub(all) struct SchemaIssue {
code : String
entity_id : Int
entity_name : String
message : String
severity : DiagnosticSeverity
} derive(Debug)pub(all) struct SchemaProfile {
name : String
version : SchemaVersion
rules : Array[SchemaRule]
known_entity_count : Int
} derive(Debug)pub(all) struct SchemaReport {
profile : SchemaProfile
checked_entities : Int
issues : Array[SchemaIssue]
error_count : Int
warning_count : Int
} derive(Debug)pub(all) struct SearchHit {
entity_id : Int
product_id : Int?
field : SearchField
value : String
} derive(Debug)pub(all) struct SectionOptions {
tolerance : Double
include_coplanar_edges : Bool
maximum_segments : Int
join_tolerance : Double
} derive(Debug)fn SectionOptions::including_coplanar_edges(self : SectionOptions, enabled : Bool) -> SectionOptionspub(all) struct SectionResult {
plane : SectionPlane
segments : Array[SectionSegment]
polylines : Array[SectionPolyline]
product_ids : Array[Int]
intersected_triangle_count : Int
total_length : Double
bounds : BoundingBox
} derive(Debug)fn SectionResult::polylines_for_product(self : SectionResult, product_id : Int) -> Array[SectionPolyline]fn SectionResult::segments_for_product(self : SectionResult, product_id : Int) -> Array[SectionSegment]pub(all) struct SourceHealth {
byte_length : Int
line_count : Int
record_count : Int
maximum_record_length : Int
reference_count : Int
balanced_parentheses : Bool
balanced_strings : Bool
has_iso_header : Bool
has_end_marker : Bool
} derive(Debug)fn SpaceAdjacencyGraph::edge(self : SpaceAdjacencyGraph, left : Int, right : Int) -> SpaceAdjacency?fn SpaceAdjacencyGraph::shortest_path(self : SpaceAdjacencyGraph, start : Int, goal : Int) -> Array[Int]?pub(all) struct SpatialEntry {
product_id : Int
entity_id : Int
ifc_type : String
name : String?
container : Int?
bounds : BoundingBox
geometry_count : Int
point_count : Int
triangle_count : Int
} derive(Debug)pub(all) struct SpatialHit {
product_id : Int
entity_id : Int
bounds : BoundingBox
relation : BoxRelation
distance : Double
overlap_volume : Double
} derive(Debug)pub(all) struct SpatialIndex {
entries : Array[SpatialEntry]
cells : Map[String, Array[Int]]
bounds : BoundingBox
cell_size : Double
} derive(Debug)fn SpatialIndex::intersections(self : SpatialIndex, query : BoundingBox, tolerance? : Double) -> Array[SpatialEntry]fn SpatialIndex::nearest(self : SpatialIndex, point : Point3, maximum_distance? : Double) -> SpatialHit?fn SpatialIndex::new(model : Model, options? : SpatialIndexOptions) -> SpatialIndex raise ParseErrorfn SpatialIndex::products_in_container(self : SpatialIndex, container_id : Int) -> Array[SpatialEntry]fn SpatialIndex::query_box(self : SpatialIndex, query : BoundingBox, tolerance? : Double) -> Array[SpatialHit]fn SpatialIndex::query_point(self : SpatialIndex, point : Point3, tolerance? : Double) -> Array[SpatialHit]fn SpatialIndex::query_range(self : SpatialIndex, minimum : Point3, maximum : Point3, tolerance? : Double) -> Array[SpatialHit]fn SpatialIndex::query_sphere(self : SpatialIndex, center : Point3, radius : Double) -> Array[SpatialHit]fn SpatialIndex::raycast(self : SpatialIndex, origin : Point3, direction : Vector3, maximum_distance? : Double) -> Array[SpatialHit]fn SpatialIndex::raycast_first(self : SpatialIndex, origin : Point3, direction : Vector3, maximum_distance? : Double) -> SpatialHit?fn SpatialIndex::relation_between(self : SpatialIndex, left_id : Int, right_id : Int, tolerance? : Double) -> BoxRelation?fn SpatialIndex::within(self : SpatialIndex, container : BoundingBox, tolerance? : Double) -> Array[SpatialEntry]pub(all) struct SpatialIndexOptions {
cell_size : Double
include_empty : Bool
maximum_entries : Int
} derive(Debug)fn SpatialIndexOptions::including_empty(self : SpatialIndexOptions, include_empty : Bool) -> SpatialIndexOptionsfn SpatialIndexOptions::with_cell_size(self : SpatialIndexOptions, cell_size : Double) -> SpatialIndexOptionsfn SpatialIndexOptions::with_maximum_entries(self : SpatialIndexOptions, maximum_entries : Int) -> SpatialIndexOptionspub(all) struct SpatialMetrics {
node_count : Int
leaf_count : Int
product_count : Int
max_depth : Int
occupied_volume : Double
bounds : BoundingBox
} derive(Debug)pub(all) struct SpatialNode {
id : Int
ifc_type : String
name : String?
children : Array[SpatialNode]
products : Array[Int]
} derive(Debug)pub(all) struct SpatialSchedule {
rows : Array[SpatialScheduleRow]
total_spaces : Int
total_products : Int
total_area : Double
total_volume : Double
} derive(Debug)pub(all) struct SpatialScheduleRow {
id : Int
name : String
ifc_type : String
path : Array[Int]
product_count : Int
door_count : Int
window_count : Int
wall_count : Int
area : Double
volume : Double
bounds : BoundingBox
} derive(Debug)pub(all) struct StepDocumentStats {
byte_length : Int
line_count : Int
entity_count : Int
reference_count : Int
string_count : Int
comment_count : Int
} derive(Debug)pub(all) struct StepRecord {
id : Int
name : String
start_offset : Int
end_offset : Int
line : Int
raw : String
} derive(Debug)pub(all) struct StreamBatch {
sequence : Int
start_offset : Int
end_offset : Int
records : Array[StepRecord]
complete : Bool
} derive(Debug)pub(all) struct StreamSelection {
records : Array[StepRecord]
examined : Int
selected : Int
truncated : Bool
first_offset : Int
last_offset : Int
} derive(Debug)pub(all) struct StreamStats {
source_length : Int
record_count : Int
reference_count : Int
max_record_length : Int
comment_count : Int
line_count : Int
schema : String?
} derive(Debug)pub(all) struct TakeoffGroup {
key : String
product_count : Int
quantities : Array[QuantityValue]
} derive(Debug)pub(all) struct TakeoffOptions {
grouping : QuantityGrouping
include_empty : Bool
include_unknown : Bool
use_mesh_measurements : Bool
include_surface_area : Bool
minimum_value : Double
} derive(Debug)pub(all) struct TakeoffReport {
products : Array[ProductTakeoff]
groups : Array[TakeoffGroup]
unit_system : UnitSystem
source_schema : String
skipped_products : Int
} derive(Debug)pub(all) struct TopologyIssue {
kind : TopologyIssueKind
triangle : Int?
vertex_a : Int?
vertex_b : Int?
message : String
} derive(Debug)pub(all) struct TopologyReport {
point_count : Int
triangle_count : Int
valid_triangle_count : Int
edge_count : Int
boundary_edge_count : Int
non_manifold_edge_count : Int
degenerate_triangle_count : Int
invalid_index_count : Int
component_count : Int
euler_characteristic : Int
surface_area : Double
signed_volume : Double
issues : Array[TopologyIssue]
} derive(Debug)fn TopologyReport::issues_of(self : TopologyReport, kind : TopologyIssueKind) -> Array[TopologyIssue]pub(all) struct Transform3 {
m00 : Double
m01 : Double
m02 : Double
m10 : Double
m11 : Double
m12 : Double
m20 : Double
m21 : Double
m22 : Double
tx : Double
ty : Double
tz : Double
} derive(Debug)pub(all) struct UnitAuditReport {
rows : Array[UnitAuditRow]
recognized_count : Int
unknown_count : Int
duplicate_kind_count : Int
length_scale : Double
area_scale : Double
volume_scale : Double
} derive(Debug)pub(all) struct UnitAuditRow {
entity_id : Int
kind : UnitKind
name : String
prefix : String?
to_si : Double
status : UnitAuditStatus
message : String
} derive(Debug)pub(all) struct ValidationReport {
diagnostics : Array[Diagnostic]
error_count : Int
warning_count : Int
} derive(Debug)pub(all) struct ValueStats {
node_count : Int
maximum_depth : Int
reference_count : Int
string_count : Int
number_count : Int
list_count : Int
omitted_count : Int
} derive(Debug)pub(all) struct WorkspaceSummary {
schema : String
source_length : Int
entity_count : Int
product_count : Int
indexed_products : Int
graph_nodes : Int
graph_edges : Int
rule_errors : Int
rule_warnings : Int
} derive(Debug)fn benchmark_case(name : String, product_count : Int, iterations : Int) -> BenchmarkCase raise ParseErrorfn benchmark_fixture(product_count : Int) -> Stringfn clash_pairs_between(spatial : SpatialIndex, left_ids : Array[Int], right_ids : Array[Int], options? : ClashOptions) -> Array[ClashPair]fn classification_references(index : ModelIndex, product : Product) -> Array[ClassificationReference]fn clearances_below(spatial : SpatialIndex, clearance : Double, options? : ClashOptions) -> Array[ClashPair]fn formula_quantity(model : Model, product_id : Int, formula : QuantityFormula) -> QuantityValue? raise ParseErrorfn formula_takeoff(model : Model, formulas : Array[QuantityFormula]) -> FormulaTakeoff raise ParseErrorfn formula_takeoff_for_kind(model : Model, kind : ProductKind, formulas : Array[QuantityFormula]) -> FormulaTakeoff raise ParseErrorfn geometry_report_for_product(model : Model, product_id : Int) -> ProductGeometryReport? raise ParseErrorfn mesh_for_product_pipeline(index : ModelIndex, product : Product, options? : MeshPipelineOptions) -> MeshPipelineResult raise ParseErrorfn mesh_lod_result(mesh : Mesh, target_triangles : Int, options? : MeshPipelineOptions) -> MeshPipelineResultfn minimal_fixture() -> Stringfn model_delivery_gate_with_policy(source : String, policy : QualityPolicy, options : AssetManifestOptions) -> Bool raise ParseErrorfn model_delivery_report_with_policy(source : String, policy : QualityPolicy, options : AssetManifestOptions) -> ModelDeliveryReport raise ParseErrorfn model_quality_audit(model : Model, policy? : QualityPolicy) -> ModelQualityReport raise ParseErrorfn model_slice_for_box(model : Model, bounds : BoundingBox, include_dependencies? : Bool) -> ModelSlice raise ParseErrorfn model_slice_for_products(model : Model, product_ids : Array[Int], include_dependencies? : Bool) -> ModelSlicefn model_slice_for_query(model : Model, plan : ProductQueryPlan, include_dependencies? : Bool) -> ModelSlice raise ParseErrorfn normalize_quantity(product_id : Int, quantity : QuantityValue, target_unit~ : String?) -> NormalizedQuantityfn normalize_takeoff(report : TakeoffReport, target_length_unit? : String, target_area_unit? : String, target_volume_unit? : String) -> Array[NormalizedQuantity]fn normalized_quantities_for_product(rows : Array[NormalizedQuantity], product_id : Int) -> Array[NormalizedQuantity]fn normalized_quantities_unrecognized(rows : Array[NormalizedQuantity]) -> Array[NormalizedQuantity]fn property_sets_for_product(index : ModelIndex, product : Product) -> Array[PropertySet] raise ParseErrorfn property_table_for_kind(model : Model, kind : ProductKind, names? : Array[String]) -> PropertyTable raise ParseErrorfn property_table_for_products(model : Model, products : Array[Product], names? : Array[String]) -> PropertyTable raise ParseErrorfn quantity_note(product_id : Int, kind : QuantityKind, message : String, severity? : DiagnosticSeverity) -> QuantityNotefn revision_delivery(before : Model, after : Model, options? : AssetManifestOptions) -> RevisionDelivery raise ParseErrorfn revision_delivery_invalidated_paths(before : Model, after : Model) -> Array[String] raise ParseErrorfn scene_partition_for_products(spatial : SpatialIndex, product_ids : Array[Int], chunk_size? : Int) -> ScenePartitionfn scene_selection(model : Model, camera : SceneCamera, options? : SceneQueryOptions) -> SceneSelection raise ParseErrorfn schema_validate_entity(profile : SchemaProfile, model : Model, entity_id : Int) -> Array[SchemaIssue]fn section_mesh(product_id : Int, mesh : Mesh, plane : SectionPlane, options? : SectionOptions) -> Array[SectionSegment]fn section_model(model : Model, plane : SectionPlane, options? : SectionOptions) -> SectionResult raise ParseErrorfn section_result_long_segments(result : SectionResult, minimum_length : Double) -> Array[SectionSegment]fn source_is_safe_for_full_parse(source : String, maximum_chars : Int, maximum_records : Int) -> Boolfn stream_records_in_batches(source : String, batch_size : Int, filter? : StreamFilter) -> Array[StepRecord]fn stream_select_products(source : String, filter? : StreamFilter) -> Array[Entity] raise ParseErrorfn takeoff_for_product(model : Model, product_id : Int, options? : TakeoffOptions) -> ProductTakeoff? raise ParseErrorfn workspace_export(workspace : ModelWorkspace, options? : ExportOptions) -> ExportedAsset raise ParseErrorfn workspace_products_at_point(workspace : ModelWorkspace, point : Point3, tolerance? : Double) -> Array[SpatialHit]fn workspace_query_by_kind(workspace : ModelWorkspace, kind : ProductKind) -> Array[Product] raise ParseErrorfn workspace_query_by_type(workspace : ModelWorkspace, ifc_type : String) -> Array[Product] raise ParseErrorInstall
Download zipA zero-dependency IFC STEP parser and BIM extraction engine for MoonBit