[137] Stützen im 3D anwählbar; Goldens EG (unsichtbare Baurechts-Bänder)
This commit is contained in:
10 files changed
+88
-12
No files matched your search
@@ -161,6 +161,7 @@ export {
|
||||
export {
|
||||
DRAWING_PICK_TOLERANCE,
|
||||
type PickContextMesh,
|
||||
type PickColumnMesh,
|
||||
type PickDrawingSeg,
|
||||
type PickOpening,
|
||||
type PickRoof,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
viewBox -41.5 0 95 63.6
|
||||
bytes 146250
|
||||
bytes 147364
|
||||
circle 16
|
||||
line 832
|
||||
path 68
|
||||
polygon 249
|
||||
polygon 257
|
||||
rect 1
|
||||
svg 1
|
||||
text 121
|
||||
hash 51b01852d2618ab4
|
||||
hash 45e68ce965a49c5d
|
||||
@@ -1,10 +1,10 @@
|
||||
viewBox -41.5 0 95 63.6
|
||||
bytes 146660
|
||||
bytes 147796
|
||||
circle 16
|
||||
line 832
|
||||
path 68
|
||||
polygon 249
|
||||
polygon 257
|
||||
rect 1
|
||||
svg 1
|
||||
text 121
|
||||
hash d9e3d1d506de326b
|
||||
hash dea353f151ea1cc1
|
||||
@@ -96,3 +96,9 @@ export interface PickContextMesh {
|
||||
tris: ReadonlyArray<readonly [Vec3, Vec3, Vec3]>;
|
||||
contextObjectId: string;
|
||||
}
|
||||
|
||||
/** [137] Stütze für den Raycast: WORLD-Dreiecke ihres Prismas (Konvention wie {@link PickContextMesh}). */
|
||||
export interface PickColumnMesh {
|
||||
tris: ReadonlyArray<readonly [Vec3, Vec3, Vec3]>;
|
||||
columnId: string;
|
||||
}
|
||||
@@ -44,7 +44,7 @@ import type { Project, Vec2 } from "../model/types";
|
||||
import type { DetailLevel } from "../model/viewTypes";
|
||||
import { documentFor } from "../core/document";
|
||||
import { coreEpoch } from "../engine/coreWasm";
|
||||
import type { PickOpening, PickRoof, PickStair, PickContextMesh, PickDrawingSeg } from "./pickTypes";
|
||||
import type { PickOpening, PickRoof, PickStair, PickContextMesh, PickColumnMesh, PickDrawingSeg } from "./pickTypes";
|
||||
import {
|
||||
type RMesh,
|
||||
type RModel3d,
|
||||
@@ -328,6 +328,7 @@ export function pickGeometry(
|
||||
stairs: PickStair[];
|
||||
roofs: PickRoof[];
|
||||
contextMeshes: PickContextMesh[];
|
||||
columns: PickColumnMesh[];
|
||||
drawings: PickDrawingSeg[];
|
||||
} {
|
||||
return documentFor(project).query("pickGeometry", [explodeGap(explode)]);
|
||||
|
||||
@@ -383,6 +383,10 @@ export function useMouseSelectionHandlers(opts: {
|
||||
setSelection({ ...clearKinds(), stairs: [hit.id] });
|
||||
return;
|
||||
}
|
||||
if (hit.kind === "column") {
|
||||
setSelection({ ...clearKinds(), columns: [hit.id] });
|
||||
return;
|
||||
}
|
||||
if (hit.kind === "roof") {
|
||||
// Schnittlinien bleiben hier (wie bisher) gewählt.
|
||||
setSelection({ ...clearKinds(...ELEMENT_KINDS.filter((k) => k !== "sectionLines")), roofs: [hit.id] });
|
||||
|
||||
@@ -81,7 +81,7 @@ import {
|
||||
|
||||
/** Ein per 3D-Klick getroffenes Bauteil, oder null (Leerraum). */
|
||||
export type Pick3dHit =
|
||||
| { kind: "wall" | "ceiling" | "opening" | "stair" | "roof" | "contextObject" | "drawing"; id: string }
|
||||
| { kind: "wall" | "ceiling" | "opening" | "stair" | "roof" | "contextObject" | "drawing" | "column"; id: string }
|
||||
| null;
|
||||
|
||||
/** Klick-vs-Drag-Schwelle (Pixel): bleibt die Maus zwischen pointerdown und
|
||||
@@ -1406,7 +1406,7 @@ export function Wasm3DViewport({
|
||||
const ndc = toNdc(clientX, clientY);
|
||||
if (!cb || !o || !ndc) return;
|
||||
const ray = cameraRay(orbitCamera(o), ndc.ndcX, ndc.ndcY, ndc.aspect);
|
||||
const { walls, slabs, openings, stairs, roofs, contextMeshes, drawings } = pickGeometry(
|
||||
const { walls, slabs, openings, stairs, roofs, contextMeshes, drawings, columns } = pickGeometry(
|
||||
projectRef.current,
|
||||
explodeRef.current,
|
||||
);
|
||||
@@ -1414,7 +1414,7 @@ export function Wasm3DViewport({
|
||||
// Meshes + freie 2D-Zeichnungen (Linie/Polylinie/Rechteck, s.
|
||||
// `pickDrawingSegs`) — sonst wären im WASM-Viewport 2D-Elemente NIE
|
||||
// anwählbar gewesen (Nutzer-Report).
|
||||
const hit = pickNearest(ray, walls, slabs, openings, stairs, roofs, contextMeshes, drawings);
|
||||
const hit = pickNearest(ray, walls, slabs, openings, stairs, roofs, contextMeshes, drawings, columns);
|
||||
cb(hit ? { kind: hit.kind, id: hit.id } : null, additive);
|
||||
};
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
|
||||
import { DRAWING_PICK_TOLERANCE } from "../core";
|
||||
import type { Vec3, PickWall, PickOpening, PickDrawingSeg, PickSlab, PickStair, PickRoof, PickContextMesh } from "../core";
|
||||
import type { Vec3, PickWall, PickOpening, PickDrawingSeg, PickSlab, PickStair, PickRoof, PickContextMesh, PickColumnMesh } from "../core";
|
||||
|
||||
/** Kamera-Parameter für den Pick-Strahl (Teilmenge von Camera3d). */
|
||||
export interface RayCamera {
|
||||
@@ -42,7 +42,7 @@ export interface Ray {
|
||||
|
||||
/** Ergebnis eines Picks: getroffenes Bauteil + Distanz entlang des Strahls. */
|
||||
export interface PickHit {
|
||||
kind: "wall" | "ceiling" | "opening" | "stair" | "roof" | "contextObject" | "drawing";
|
||||
kind: "wall" | "ceiling" | "opening" | "stair" | "roof" | "contextObject" | "drawing" | "column";
|
||||
id: string;
|
||||
t: number;
|
||||
/** Bei `kind:"opening"` dieselbe Id wie `id` (ausdrucksstärkerer Zugriff). */
|
||||
@@ -357,6 +357,7 @@ export function pickNearest(
|
||||
roofs?: readonly PickRoof[],
|
||||
contextMeshes?: readonly PickContextMesh[],
|
||||
drawings?: readonly PickDrawingSeg[],
|
||||
columns?: readonly PickColumnMesh[],
|
||||
): PickHit | null;
|
||||
/**
|
||||
* Nächstes getroffenes Bauteil (kleinstes t) über Wände, Decken, Öffnungen und
|
||||
@@ -376,6 +377,7 @@ export function pickNearest(
|
||||
roofs: readonly PickRoof[] = [],
|
||||
contextMeshes: readonly PickContextMesh[] = [],
|
||||
drawings: readonly PickDrawingSeg[] = [],
|
||||
columns: readonly PickColumnMesh[] = [],
|
||||
): PickHit | null {
|
||||
const TIE_EPS = 1e-6;
|
||||
let hit: PickHit | null = null;
|
||||
@@ -426,6 +428,11 @@ export function pickNearest(
|
||||
consider({ kind: "contextObject", id: m.contextObjectId, t, contextObjectId: m.contextObjectId }, 1);
|
||||
}
|
||||
}
|
||||
// [137] Stützen: Prisma-Dreiecke, Rang wie Wand/Decke.
|
||||
for (const c of columns) {
|
||||
const t = rayContextMeshTris(ray, { tris: c.tris, contextObjectId: c.columnId });
|
||||
if (t !== null) consider({ kind: "column", id: c.columnId, t }, 1);
|
||||
}
|
||||
return hit;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user