mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-11 22:31:55 +00:00
ifcviewer: auto-guess FederatedFalseOrigin on first model added
When the user adds a model into a fresh, untitled federation that still
has the default (0,0,0, no rotation) FederatedFalseOrigin, derive an
origin from the first instance's placement_transformation (lifted
through CoordinateOperation when enabled) and the helmert grid-north
baked into ModelGeoref::coordinate_operation_meters. Multi-file batches
naturally settle: whichever load finishes first anchors the federation,
the rest see a non-default origin and skip. Saved .ifcfeds keep their
authoritative origin.
Adds Placement.{h,cpp} (port of util/placement.py — a2p,
get_axis2placement, get_local_placement) so Geolocation no longer needs
its own anonymous getAxis2Placement, and xaxis2angleDeg in Geolocation
mirroring util/geolocation.xaxis2angle.
SceneLoader captures the first instance's placement_transformation from
either the sidecar's InstanceCpu[0] or the streamer's first
InstanceChunk, so the guess works on both load paths without re-reading
the IFC.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -100,4 +100,9 @@ Eigen::Matrix4d helmertMetersFromParameters(const HelmertTransformation& params,
|
||||
// calculateUnitScale(file, "LENGTHUNIT") in that case.
|
||||
std::optional<express::Base> getMapUnit(ifcopenshell::file* ifc_file);
|
||||
|
||||
// "How do I rotate project east to get to grid east?" — i.e. -atan2(xao, xaa)
|
||||
// converted to degrees, anticlockwise positive. Mirrors
|
||||
// ifcopenshell.util.geolocation.xaxis2angle.
|
||||
double xaxis2angleDeg(double xaa, double xao);
|
||||
|
||||
#endif // GEOLOCATION_H
|
||||
|
||||
Reference in New Issue
Block a user