[144] Merge: Öffnungen – Masse ziehen mit, Bogenwände, keine Überlappung, Dachfenster verschieben

This commit is contained in:
Claude committed 2026-11-06 08:05:52 +00:00
commit ef750c5ac4
28 files changed
+846 -149

No files matched your search

+3
View File
@@ -1028,6 +1028,7 @@ export default function App() {
updateWall,
setWallThickness,
updateOpening,
slideOpening,
moveCeilingGrip,
moveExcavationGrip,
moveExcavationEdge,
@@ -1132,6 +1133,7 @@ export default function App() {
engineRef,
commandLineRef,
updateOpening,
slideOpening,
updateWall,
moveStairBy,
moveRoomGrip,
@@ -1973,6 +1975,7 @@ export default function App() {
updateWall,
setWallThickness,
updateOpening,
slideOpening,
updateCeiling,
setCeilingThickness,
updateStair,
+7 -2
View File
@@ -157,11 +157,16 @@ describe("Transformations-Befehle", () => {
expect(engine.isActive()).toBe(false);
expect(door().position).toBeCloseTo(1.3, 9);
expect(door().hostWallId).toBe("W1");
// Relative Koordinate quer zur Wand: nur der Anteil längs zählt; am Wandende geklemmt.
// Relative Koordinate quer zur Wand: nur der Anteil längs zählt; 5 cm vor dem Fenster O1 (3.0–4.0)
// angehalten ([144] Überlappung), zurück am Wandanfang geklemmt.
engine.start("move");
engine.pick({ x: 0, y: 0 });
engine.submitText("@9,0.05");
expect(door().position).toBeCloseTo(5 - 0.9, 9);
expect(door().position).toBeCloseTo(3 - 0.05 - 0.9, 9);
engine.start("move");
engine.pick({ x: 0, y: 0 });
engine.submitText("@-9,0");
expect(door().position).toBe(0);
for (const op of ["rotate", "mirror"]) {
expect(engine.start(op)).toBe(false);
}
+6 -5
View File
@@ -458,20 +458,21 @@ export class ProjectDocument {
/**
* Befehl rechnen und anwenden ([K4] S3, `doc_cmd_commit`): wie {@link commitGrip} — ein Kern-Aufruf
* statt Ops hin (Rechnung) und zurück (Commit). Ergebnis: neues Projekt und die angewendeten Ops (leer
* = nichts zu tun, dann `project === base`) oder die Meldungen der Prüfung.
* = nichts zu tun, dann `project === base`), ein Hinweis-Schlüssel (i18n, z. B. [144] Öffnung an der
* Nachbaröffnung angehalten) oder die Meldungen der Prüfung.
*/
commitCmd(base: Project, req: object, coalesceKey: string | undefined, now: number): { project: Project; ops: CoreOp[] } | { problems: string[] } {
commitCmd(base: Project, req: object, coalesceKey: string | undefined, now: number): { project: Project; ops: CoreOp[]; notice?: string } | { problems: string[] } {
this.ensure(base);
if (!this.handle) return { problems: ["Projekt-Dokument im Kern nicht offen."] };
const out = core().doc_cmd_commit(this.handle, toMarkedJson(req), coalesceKey ?? "", now);
if (out.startsWith("\u0001")) throw new Error(out.slice(1));
const r = fromMarkedJson<{ ops: CoreOp[] } | { problems: string[] }>(out);
const r = fromMarkedJson<{ ops: CoreOp[]; notice?: string } | { problems: string[] }>(out);
if ("problems" in r) return r;
if (r.ops.length === 0) return { project: base, ops: r.ops };
if (r.ops.length === 0) return { project: base, ops: r.ops, notice: r.notice };
const extra = this.lastExtra();
const project = this.withExtra(applyOps(base, r.ops), extra);
this.setMirror(project);
return { project, ops: extra.length ? [...r.ops, ...extra] : r.ops };
return { project, ops: extra.length ? [...r.ops, ...extra] : r.ops, notice: r.notice };
}
/**
+1 -1
View File
@@ -72,7 +72,7 @@ export { drawingVertices, gripPt, openEdges, polylineEdgeGrips, ringEdges } from
export { verticalExtents } from "../geometry/grips";
export type { VerticalExtent } from "../geometry/grips";
export type { GripRequest } from "../geometry/grips";
export { coincidentGripPoints, excavationGripPoints, gripAxisLock, gripEdgeTarget, gripPolar, gripPolarPoint, openingGripPoint, openingSheetSlide, openingSlidePosition, sheetHeightDrag, stairMoveHandle, wallGripPoints } from "../geometry/gripDrag";
export { coincidentGripPoints, excavationGripPoints, gripAxisLock, gripEdgeTarget, gripPolar, gripPolarPoint, openingGripPoint, openingSheetSlide, sheetHeightDrag, stairMoveHandle, wallGripPoints } from "../geometry/gripDrag";
export type { EdgeDrive, GripLocks, SheetHeightKind } from "../geometry/gripDrag";
export { openingPreviewProject, openingPreviewSvgs } from "../plan/openingPreview";
export type { OpeningPreviewSvgs } from "../plan/openingPreview";
+4 -3
View File
@@ -9,7 +9,6 @@ import {
gripPolarPoint,
openingGripPoint,
openingSheetSlide,
openingSlidePosition,
sheetHeightDrag,
wallGripPoints,
} from "./gripDrag";
@@ -49,8 +48,10 @@ describe("Griff-Zug (Kern)", () => {
it("Öffnung entlang der Wand und im Schnitt", () => {
expect(openingGripPoint(wall, { position: 1, width: 1.2 })).toEqual({ x: 1.6, y: 0 });
expect(openingSlidePosition(wall, { width: 1.2 }, { x: 2.6, y: 3 })).toBe(2);
expect(openingSlidePosition({ start: wall.start, end: wall.start }, { width: 1.2 }, { x: 1, y: 0 })).toBeNull();
// Bogenwand (Halbkreis, Radius 2.5): Mitte bei der Bogenlänge 2.5·π/2 liegt im Scheitel.
const g = openingGripPoint({ ...wall, bulge: 1 }, { position: 2.5 * Math.PI / 2 - 0.6, width: 1.2 });
expect(g.x).toBeCloseTo(2.5, 9);
expect(Math.abs(g.y)).toBeCloseTo(2.5, 9);
expect(openingSheetSlide(wall, { position: 1, width: 1.2 }, { x: -1, y: 0 }, 0.5)).toEqual({ position: 0.5, du: 0.5 });
expect(openingSheetSlide(wall, { position: 1, width: 1.2 }, { x: 0.1, y: 0.995 }, 1)).toBeNull();
});
+6 -9
View File
@@ -96,15 +96,12 @@ export function sheetHeightDrag(
return { top: f[0], bottom: f[1], patch };
}
/** Mittelpunkt-Griff einer Öffnung auf der Achse ihrer Wirtswand. */
export function openingGripPoint(w: Pick<Wall, "start" | "end">, op: Pick<Opening, "position" | "width">): Vec2 {
return v(core().grip_opening_point(w.start.x, w.start.y, w.end.x, w.end.y, op.position, op.width));
}
/** Neue `position` beim Ziehen des Öffnungs-Griffs nach `pt` (auf die Wand geklemmt); null = Wand ohne Länge. */
export function openingSlidePosition(w: Pick<Wall, "start" | "end">, op: Pick<Opening, "width">, pt: Vec2): number | null {
const f = core().grip_opening_slide(w.start.x, w.start.y, w.end.x, w.end.y, op.width, pt.x, pt.y);
return f.length ? f[0] : null;
/**
* Mittelpunkt-Griff einer Öffnung auf der Achse ihrer Wirtswand (Bogenwand [T2]: auf dem Bogen, `position`
* = Bogenlänge). Den Zug selbst rechnet der Kern (`slideOpening`, Griff-Anfrage `openingSlide`).
*/
export function openingGripPoint(w: Pick<Wall, "start" | "end" | "bulge">, op: Pick<Opening, "position" | "width">): Vec2 {
return v(core().grip_opening_point(w.start.x, w.start.y, w.end.x, w.end.y, w.bulge ?? 0, op.position, op.width));
}
/**
+4 -1
View File
@@ -31,7 +31,10 @@ export type GripRequest =
| { op: "insertPoint"; id: string; seg: number; pt: P }
| { op: "deletePoint"; id: string; index: number }
| { op: "vertexType"; id: string; index: number; vertexType: "corner" | "arc" | "spline" }
| { op: "wallThickness" | "ceilingThickness"; id: string; thickness: number; newId: string; newName: string };
| { op: "wallThickness" | "ceilingThickness"; id: string; thickness: number; newId: string; newName: string }
// [144] Wandöffnung gleiten lassen (Kern `opening_slide`): Griff-Zug nach `pt` bzw. Position `a` ab Wandanfang.
| { op: "openingSlide"; id: string; pt: P }
| { op: "openingPosition"; id: string; a: number };
/** Punkt als Anfrage-Paar. */
export const gripPt = (p: Vec2): P => [p.x, p.y];
+2
View File
@@ -801,6 +801,8 @@ export const de = {
"objinfo.opening.slope": "Neigung der Fläche",
"objinfo.opening.position": "Position (ab Wandanfang)",
"objinfo.opening.positionEnd": "Abstand ab Wandende",
"opening.overlapClamped": "Öffnung hält vor der Nachbaröffnung an (Steg 5 cm).",
"opening.noRoom": "In der Zielwand ist kein Platz für die Öffnung.",
"objinfo.opening.width": "Breite",
"objinfo.opening.height": "Höhe",
"objinfo.opening.sill": "Brüstung",
+2
View File
@@ -800,6 +800,8 @@ export const en: Record<TranslationKey, string> = {
"objinfo.opening.slope": "Surface slope",
"objinfo.opening.position": "Position (from wall start)",
"objinfo.opening.positionEnd": "Distance from wall end",
"opening.overlapClamped": "Opening stops at the neighbouring opening (5 cm web).",
"opening.noRoom": "No room for the opening in the target wall.",
"objinfo.opening.width": "Width",
"objinfo.opening.height": "Height",
"objinfo.opening.sill": "Sill height",
+24 -2
View File
@@ -403,6 +403,12 @@ export interface ProjectSlice {
id: string,
patch: Partial<import("../model/types").Opening>,
) => void;
/**
* [144] Wandöffnung in ihrer Wand verschieben (Kern `opening_slide`): auf `position` (ab Wandanfang,
* Bogenwand: Bogenlänge) bzw. zum Griff-Punkt `pt`; geklemmt auf die Wand und 5 cm vor der Nachbar-
* öffnung (mit Hinweis). `coalesceKey` fasst einen Griff-Zug zu einem Undo-Schritt.
*/
slideOpening: (id: string, to: { position: number } | { pt: Vec2 }, coalesceKey?: string) => void;
/**
* Immutable Änderung eines Dachs (Form/Neigung/Überstand/Firstrichtung/
@@ -522,7 +528,8 @@ export function createProjectSlice(
// Befehl ([K4] S3, `commands.rs`): der Kern rechnet ihn auf dem Dokument und wendet ihn im selben
// Aufruf an (`cmdMutation`); Prüfung, Verlauf und Meldungen wie `commitOps`.
const applyCmd = (req: object, coalesceKey?: string) =>
const applyCmd = (req: object, coalesceKey?: string) => {
let notice: string | undefined;
set((s) => {
const doc = storeDocument(s.project);
const cmd = (req as { cmd?: unknown }).cmd;
@@ -535,11 +542,14 @@ export function createProjectSlice(
queueMicrotask(() => get().notify(`${t("project.change.rejected")} ${problems[0]}`, "error"));
return {};
}
notice = res.notice;
if (res.ops.length === 0) return {};
opLog.push(res.ops);
if (opLog.length > OP_LOG_LIMIT) opLog.shift();
return { project: res.project, ...historyPatch(doc) };
});
noticeOnce(notice);
};
// Änderung direkt als Ops (ohne Differenz), s. `ProjectSlice.applyChange`.
const applyChange = (
@@ -547,6 +557,16 @@ export function createProjectSlice(
coalesceKey?: string,
) => set((s) => commitOps(s, typeof ops === "function" ? ops(s.project) : ops, coalesceKey));
// Hinweis aus dem Kern (i18n-Schlüssel) melden — derselbe höchstens alle 2 s (Griff-Zug: je Mausschritt).
let lastNotice = { key: "", at: 0 };
const noticeOnce = (notice: string | undefined) => {
if (!notice) return;
const now = Date.now();
if (notice === lastNotice.key && now - lastNotice.at < 2000) return;
lastNotice = { key: notice, at: now };
get().notify(t(notice as Parameters<typeof t>[0]), "warning");
};
// Griff-Änderung ([K4] S3): der Kern rechnet sie auf dem Dokument und wendet sie im selben Aufruf an
// (`grips.rs`, ein WASM-Aufruf je Mausschritt); Prüfung, Verlauf und Meldungen wie `commitOps`.
const applyGrip = (req: GripRequest, coalesceKey?: string) => {
@@ -566,7 +586,7 @@ export function createProjectSlice(
if (opLog.length > OP_LOG_LIMIT) opLog.shift();
return { project: res.project, ...historyPatch(doc) };
});
if (notice) get().notify(t(notice as Parameters<typeof t>[0]), "warning");
noticeOnce(notice);
};
return {
@@ -1239,6 +1259,8 @@ export function createProjectSlice(
// ── Öffnungs-Editieren ────────────────────────────────────────────────
updateOpening: (id, patch) => applyChange((p) => patchItem(p, "openings", id, patch)),
slideOpening: (id, to, coalesceKey) =>
applyGrip("pt" in to ? { op: "openingSlide", id, pt: gripPt(to.pt) } : { op: "openingPosition", id, a: to.position }, coalesceKey),
// ── Dach-Editieren ─────────────────────────────────────────────────────
updateRoof: (id, patch, coalesceKey) => applyChange((p) => patchItem(p, "roofs", id, patch), coalesceKey),
+9
View File
@@ -26,6 +26,10 @@ declare global {
openings: () => { id: string; hostWallId: string; position: number }[];
/** [144] Auswahl setzen (wie ein Klick), z. B. `{ openings: ["D1"] }`. */
select: (patch: Record<string, string[]>) => void;
/** [144] Punkte einer Bemassung (Kette) — folgt sie der Öffnung? */
dimPts: (id: string) => { x: number; y: number }[];
/** [144] Texte der Hinweise (Benachrichtigungen). */
notices: () => string[];
};
}
}
@@ -52,6 +56,11 @@ export function installTestHooks(): void {
getState().project.drawings2d.flatMap((d) => (d.id.startsWith(prefix) && d.geom.shape === "polyline" ? [{ id: d.id, pts: d.geom.pts }] : [])),
openings: () => (getState().project.openings ?? []).map((o) => ({ id: o.id, hostWallId: o.hostWallId, position: o.position })),
select: (patch) => getState().setSelection(patch),
dimPts: (id) => {
const g = getState().project.drawings2d.find((d) => d.id === id)?.geom;
return g?.shape === "dimension" ? g.pts.map((p) => ({ x: p.x, y: p.y })) : [];
},
notices: () => getState().notifications.map((n) => n.message),
selected: () => ({ drawings: [...getState().selection.drawings], groups: [...getState().selection.groups], all: JSON.stringify(getState().selection) }),
};
}
+13 -8
View File
@@ -22,7 +22,6 @@ import {
gripPolarPoint,
openingGripPoint,
openingSheetSlide,
openingSlidePosition,
sheetHeightDrag,
stairMoveHandle,
wallGripPoints,
@@ -93,6 +92,8 @@ export function useGripEditing(opts: {
engineRef: RefObject<CommandEngine | null>;
commandLineRef: RefObject<CommandLineHandle | null>;
updateOpening: (id: string, patch: Record<string, unknown>) => void;
/** [144] Wandöffnung gleiten lassen (Kern: Wand, Bogenwand, Nachbaröffnungen). */
slideOpening: (id: string, to: { position: number } | { pt: Vec2 }, coalesceKey?: string) => void;
/** Wand ändern (Höhen-Griff im Schnitt); `coalesceKey` fasst einen Zug zu EINEM Undo-Schritt. */
updateWall: (id: string, patch: Partial<import("../model/types").Wall>, coalesceKey?: string) => void;
moveStairBy: (id: string, delta: Vec2) => void;
@@ -143,6 +144,7 @@ export function useGripEditing(opts: {
engineRef,
commandLineRef,
updateOpening,
slideOpening,
updateWall,
moveStairBy,
moveRoomGrip,
@@ -385,9 +387,12 @@ export function useGripEditing(opts: {
if (!selectedOpeningId) return null;
const op = (project.openings ?? []).find((o) => o.id === selectedOpeningId);
const w = op && !op.hostRoofId && !op.hostCeilingId ? project.walls.find((x) => x.id === op.hostWallId) : undefined;
if (!w) return null;
const dx = w.end.x - w.start.x;
const dy = w.end.y - w.start.y;
if (!w || !op) return null;
// Sehne über die Öffnung (gerade Wand: Wandrichtung; Bogenwand: ≈ Tangente in der Öffnungsmitte).
const a = openingGripPoint(w, { position: op.position - op.width / 2, width: op.width });
const b = openingGripPoint(w, { position: op.position + op.width / 2, width: op.width });
const dx = b.x - a.x;
const dy = b.y - a.y;
const len = Math.hypot(dx, dy);
return len > 1e-9 ? { x: dx / len, y: dy / len } : null;
};
@@ -796,9 +801,9 @@ export function useGripEditing(opts: {
if (patch) updateOpening(op.id, patch);
return;
}
const w = op && project.walls.find((x) => x.id === op.hostWallId);
const pos = op && w ? openingSlidePosition(w, op, pt) : null;
if (op && pos != null) updateOpening(op.id, { position: pos });
// Wandöffnung ([144]): der Kern projiziert auf die Achse (Bogenwand: auf den Bogen), klemmt auf
// die Wand und hält vor der Nachbaröffnung an.
if (op && !op.locked) slideOpening(op.id, { pt }, `slideOpening:${op.id}`);
return;
}
// Treppe: den Bewegpunkt verfolgen → ganze Treppe um das Delta (Ziel −
@@ -959,7 +964,7 @@ export function useGripEditing(opts: {
}
const pom = pendingOpeningMoveRef.current;
pendingOpeningMoveRef.current = null;
if (pom) updateOpening(pom.id, { position: pom.position });
if (pom) slideOpening(pom.id, { position: pom.position });
const pa = pendingAreaMoveRef.current;
pendingAreaMoveRef.current = null;
if (pa && (pa.total.x !== 0 || pa.total.y !== 0)) {
+6 -4
View File
@@ -209,6 +209,7 @@ export function usePanelHostBase(opts: {
| "updateWall"
| "setWallThickness"
| "updateOpening"
| "slideOpening"
| "updateCeiling"
| "setCeilingThickness"
| "updateStair"
@@ -324,6 +325,7 @@ export function usePanelHostBase(opts: {
updateWall,
setWallThickness,
updateOpening,
slideOpening,
updateCeiling,
setCeilingThickness,
updateStair,
@@ -952,10 +954,10 @@ export function usePanelHostBase(opts: {
},
onSetOpeningPosition: (position) => {
if (selection?.kind !== "opening" || !Number.isFinite(position)) return;
// [144] In der Wand halten: auf [0, Wandlänge − Breite] klemmen (Bogenwand: nur ≥ 0).
const o = selection.opening;
const max = o?.wallLength != null ? Math.max(0, o.wallLength - o.width) : Infinity;
updateOpening(selection.id, { position: Math.min(max, Math.max(0, position)) });
// [144] Dach-/Deckenöffnung: Feld frei; Wandöffnung: der Kern klemmt auf [0, Wandlänge − Breite]
// (Bogenwand: Bogenlänge) und hält 5 cm vor der Nachbaröffnung an (mit Hinweis).
if (selection.opening?.wallLength == null) updateOpening(selection.id, { position: Math.max(0, position) });
else slideOpening(selection.id, { position });
},
onSetOpeningSwingAngle: (swingAngle) => {
if (selection?.kind === "opening" && swingAngle > 0)
+2
View File
@@ -372,6 +372,7 @@ export function useProjectActions(
const updateWall = useStore((s) => s.updateWall);
const setWallThickness = useStore((s) => s.setWallThickness);
const updateOpening = useStore((s) => s.updateOpening);
const slideOpening = useStore((s) => s.slideOpening);
const moveCeilingGrip = useStore((s) => s.moveCeilingGrip);
const moveExcavationGrip = useStore((s) => s.moveExcavationGrip);
const moveExcavationEdge = useStore((s) => s.moveExcavationEdge);
@@ -490,6 +491,7 @@ export function useProjectActions(
updateWall,
setWallThickness,
updateOpening,
slideOpening,
moveCeilingGrip,
moveExcavationGrip,
moveExcavationEdge,
+53
View File
@@ -3,6 +3,7 @@
import { describe, expect, it } from "vitest";
import { buildComplexSampleProject } from "../model/sampleProjectComplex";
import { transformMutation } from "./transform";
import { getState } from "../state/appStore";
describe("Öffnungen verschieben (Musterhaus komplex)", () => {
it("jede Wandöffnung gleitet entlang ihrer Wand", () => {
@@ -26,3 +27,55 @@ describe("Öffnungen verschieben (Musterhaus komplex)", () => {
}
});
});
// [144] Store-Fluss: Befehl (cmdMutation), Objekt-Info/Griff (`slideOpening`) — Bemassung folgt, Bogenwand,
// Nachbaröffnung mit Hinweis, Dachöffnung allein.
describe("Öffnungen verschieben (Store, Musterhaus komplex)", () => {
const load = () => getState().loadProject(buildComplexSampleProject());
const opening = (id: string) => getState().project.openings!.find((o) => o.id === id)!;
const dimPts = () => (getState().project.drawings2d.find((d) => d.id === "mass-fenster-eg")!.geom as { pts: { x: number }[] }).pts;
it("Bemassung auf die Leibungen folgt Befehl und Objekt-Info", () => {
load();
const x0 = dimPts()[0].x;
getState().setProject(transformMutation({ wallIds: [], drawingId: null, openingIds: ["eg-f1"] }, "move", [{ x: 0, y: 0 }, { x: 0.5, y: 0 }], "move", 1));
expect(opening("eg-f1").position).toBeCloseTo(2.1, 9);
expect(dimPts()[0].x).toBeCloseTo(x0 + 0.5, 9);
expect(dimPts()[1].x).toBeCloseTo(x0 + 0.5 + opening("eg-f1").width, 9);
getState().slideOpening("eg-f1", { position: 1 });
expect(dimPts()[0].x).toBeCloseTo(x0 - 0.6, 9);
getState().undo();
expect(dimPts()[0].x).toBeCloseTo(x0 + 0.5, 9);
});
it("Bogenwand: Lage = Bogenlänge, Anschlag an der Nachbaröffnung mit Hinweis", () => {
load();
const before = getState().notifications.length;
// Erker EG (Halbkreis r = 2): f5 bei 1.2 (1 m breit), f6 bei 3.6 — f5 hält bei 3.6 − 0.05 − 1 = 2.55.
getState().slideOpening("eg-f5", { position: 3 });
expect(opening("eg-f5").position).toBeCloseTo(2.55, 9);
expect(getState().notifications.length).toBe(before + 1);
expect(getState().notifications.at(-1)?.kind).toBe("warning");
getState().undo();
expect(opening("eg-f5").position).toBe(1.2);
// Griff-Zug ausserhalb des Scheitels (17, 5): Mitte auf der halben Bogenlänge π.
getState().slideOpening("eg-f6", { pt: { x: 17.4, y: 5 } });
expect(opening("eg-f6").position).toBeCloseTo(Math.PI - 0.5, 9);
// Weiter zum Anfang: f5 endet bei 2.2 → Anschlag bei 2.25.
getState().slideOpening("eg-f6", { pt: { x: 15, y: 3 } });
expect(opening("eg-f6").position).toBeCloseTo(2.25, 9);
// Befehl: f6 übers Bogenende hinaus → Bogenlänge 2π − Breite, gleiche Wand.
getState().setProject(transformMutation({ wallIds: [], drawingId: null, openingIds: ["eg-f6"] }, "move", [{ x: 17, y: 5 }, { x: 13, y: 9 }], "move", 1));
expect(opening("eg-f6").position).toBeCloseTo(2 * Math.PI - 1, 9);
expect(opening("eg-f6").hostWallId).toBe("eg-aw-erker");
});
it("Dach-/Deckenöffnung allein verschieben", () => {
load();
const o = (getState().project.openings ?? []).find((x) => (x.hostRoofId || x.hostCeilingId) && !x.locked);
expect(o).toBeDefined();
const hp = o!.hostPoint!;
getState().setProject(transformMutation({ wallIds: [], drawingId: null, openingIds: [o!.id] }, "move", [{ x: 0, y: 0 }, { x: 0.3, y: 0 }], "move", 1));
expect(opening(o!.id).hostPoint!.x).toBeCloseTo(hp.x + 0.3, 9);
});
});