Skip to content

Commit 20f79d8

Browse files
committed
chore: update drawing editor example
1 parent d6702e2 commit 20f79d8

File tree

1 file changed

+8
-4
lines changed
  • packages/front/src/drawings/DrawingEditor

1 file changed

+8
-4
lines changed

packages/front/src/drawings/DrawingEditor/example.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,21 @@ const techDrawings = components.get(OBC.TechnicalDrawings);
9898
// The drawing is created in the hidden world so the SheetBoard can render it
9999
// through its own WebGL renderer. The main world stays clean for the BIM model.
100100
const drawing = techDrawings.create(world);
101-
drawing.three.position.set(15.4589, 11.4270, 1.0167);
102-
drawing.three.quaternion.set(0.000000, -0.707107, 0.707107, 0.000000);
101+
// Orient the drawing as a top-down floor plan: local -Y points toward world -Y
102+
// so the drawing projects straight down onto its horizontal XZ plane.
103+
drawing.orientTo(new THREE.Vector3(0, -1, 0));
104+
// Place the drawing plane at the cut elevation (~1.2 m above the floor) and
105+
// capture everything within the next 4 m below it (one-floor depth).
106+
drawing.three.position.set(0, 1.2, 0);
103107

104-
drawing.far = 3;
108+
drawing.far = 4;
105109

106110
drawing.layers.create("Visible", { material: new THREE.LineBasicMaterial({ color: 0x000000 }) });
107111
drawing.layers.create("Hidden", { material: new THREE.LineDashedMaterial({ color: 0x888888, dashSize: 0.2, gapSize: 0.1 }), visible: false });
108112
drawing.layers.create("Annotations", { material: new THREE.LineBasicMaterial({ color: 0x000000 }) });
109113
drawing.activeLayer = "Annotations";
110114

111-
const viewport = drawing.viewports.create({ left: -22, right: 16, top: 2, bottom: -14, scale: 50, name: "Detail Section" });
115+
const viewport = drawing.viewports.create({ left: -25, right: 25, top: 15, bottom: -15, scale: 100, name: "Floor Plan" });
112116

113117
/* MD
114118
### 🔭 Projecting model edges onto the drawing

0 commit comments

Comments
 (0)