CivilNavigators
Copying and pasting? We've got you covered! You can find the full source code of this tutorial here.
🛣️ Navigating 3D infrastructures
Infrastructure models — roads, tunnels, bridges — are long and thin, making standard orbit navigation nearly useless. You need a way to travel along the route and inspect any cross-section without losing your bearings. Civil navigators use the IFC alignment data reconstructed in 3D to let you scrub along the route, sync multiple views, and cut a live cross-section at any station. This tutorial covers loading a road Fragment model and extracting its 3D absolute and horizontal plan alignments; creating an absolute 3D navigator and a horizontal 2D navigator in a secondary world; syncing the marker position between both views as you move along the route; adding a cross-section clipping plane that updates perpendicular to the alignment at the marker; displaying KP station labels with configurable colors and screen-distance culling; highlighting a selected alignment; and navigating by percentage slider or by KP value. By the end, you'll have a synchronized 3D and plan-view navigation setup for infrastructure models with live cross-section cutting at any station.
import * as THREE from "three";
import * as OBC from "@thatopen/components";
import * as CUI from "@thatopen/ui-obc";
import Stats from "stats.js";
import * as BUI from "@thatopen/ui";
// You have to import * as OBF from "@thatopen/components-front"
import * as OBF from "../..";