Skip to content

Commit 2c1aa8a

Browse files
committed
fix build
1 parent b17e0dd commit 2c1aa8a

File tree

6 files changed

+54
-17
lines changed

6 files changed

+54
-17
lines changed

packages/abstract-3d/src/renderers/dxf/dxf-geometries/dxf-box.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Box, Material, Vec3, vec3TransRot, vec3RotCombine, vec3Zero, vec3Scale, vec3 } from "../../../abstract-3d.js";
22
import { color } from "../color.js";
3-
import { dxf3DFACE } from "../dxf-encoding.js";
3+
import { dxf3DFACE, Handle } from "../dxf-encoding.js";
44

5-
export function dxfBox(b: Box, m: Material, parentPos: Vec3, parentRot: Vec3, handleRef: {handle: number}): string {
5+
export function dxfBox(b: Box, m: Material, parentPos: Vec3, parentRot: Vec3, handleRef: Handle): string {
66
const pos = vec3TransRot(b.pos, parentPos, parentRot);
77
const rot = vec3RotCombine(parentRot, b.rot ?? vec3Zero);
88
const half = vec3Scale(b.size, 0.5);

packages/abstract-3d/src/renderers/dxf/dxf-geometries/dxf-cone.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
import { Cone, Material, Vec3, vec3TransRot, vec3RotCombine, vec3Zero, vec3 } from "../../../abstract-3d.js";
22
import { color } from "../color.js";
3-
import { dxf3DFACE } from "../dxf-encoding.js";
3+
import { dxf3DFACE, Handle } from "../dxf-encoding.js";
44

5-
export function dxfCone(c: Cone, m: Material, sides: number, parentPos: Vec3, parentRot: Vec3, handleRef: {handle: number}): string {
5+
export function dxfCone(
6+
c: Cone,
7+
m: Material,
8+
sides: number,
9+
parentPos: Vec3,
10+
parentRot: Vec3,
11+
handleRef: Handle
12+
): string {
613
let dxfString = "";
714
const pos = vec3TransRot(c.pos, parentPos, parentRot);
815
const rot = vec3RotCombine(parentRot, c.rot ?? vec3Zero);
@@ -22,7 +29,9 @@ export function dxfCone(c: Cone, m: Material, sides: number, parentPos: Vec3, pa
2229

2330
if (i !== 0) {
2431
const prevBot = botVec3Array[i - 1]!;
25-
dxfString += dxf3DFACE(botPos, prevBot, currBot, currBot, mat, handleRef) + dxf3DFACE(currBot, prevBot, topPos, topPos, mat, handleRef);
32+
dxfString +=
33+
dxf3DFACE(botPos, prevBot, currBot, currBot, mat, handleRef) +
34+
dxf3DFACE(currBot, prevBot, topPos, topPos, mat, handleRef);
2635
}
2736
currentAngle += angleStep;
2837
}

packages/abstract-3d/src/renderers/dxf/dxf-geometries/dxf-cylinder.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,17 @@ import {
1010
equals,
1111
} from "../../../abstract-3d.js";
1212
import { color } from "../color.js";
13-
import { dxf3DFACE } from "../dxf-encoding.js";
13+
import { dxf3DFACE, Handle } from "../dxf-encoding.js";
1414
import { dxfPlane } from "./dxf-plane.js";
1515

16-
export function dxfCylinder(c: Cylinder, m: Material, sides: number, parentPos: Vec3, parentRot: Vec3, Handle): string {
16+
export function dxfCylinder(
17+
c: Cylinder,
18+
m: Material,
19+
sides: number,
20+
parentPos: Vec3,
21+
parentRot: Vec3,
22+
handleRef: Handle
23+
): string {
1724
const angleStart = c.angleStart ?? 0.0;
1825
const angleLength = c.angleLength ?? Math.PI * 2;
1926
const angleEnd = angleStart + angleLength;

packages/abstract-3d/src/renderers/dxf/dxf-geometries/dxf-plane.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import {
99
vec3,
1010
} from "../../../abstract-3d.js";
1111
import { color } from "../color.js";
12-
import { dxf3DFACE } from "../dxf-encoding.js";
12+
import { dxf3DFACE, Handle } from "../dxf-encoding.js";
1313

14-
export function dxfPlane(p: Plane, m: Material, parentPos: Vec3, parentRot: Vec3, handleRef: {handle: number}): string {
14+
export function dxfPlane(p: Plane, m: Material, parentPos: Vec3, parentRot: Vec3, handleRef: Handle): string {
1515
const half = vec2Scale(p.size, 0.5);
1616
const pos = vec3TransRot(p.pos, parentPos, parentRot);
1717
const rot = vec3RotCombine(parentRot, p.rot ?? vec3Zero);
@@ -21,7 +21,7 @@ export function dxfPlane(p: Plane, m: Material, parentPos: Vec3, parentRot: Vec3
2121
vec3tr(half.x, -half.y),
2222
vec3tr(half.x, half.y),
2323
vec3tr(-half.x, half.y),
24-
color(m.normal),
24+
color(m.normal),
2525
handleRef
2626
);
2727
}

packages/abstract-3d/src/renderers/dxf/dxf-geometries/dxf-polygon.ts

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
import { Polygon, Material, Vec3, vec3TransRot, vec3RotCombine, vec3Zero } from "../../../abstract-3d.js";
22
import { color } from "../color.js";
3-
import { dxf3DFACE } from "../dxf-encoding.js";
3+
import { dxf3DFACE, Handle } from "../dxf-encoding.js";
44

55
const chunkSize = 4;
66

7-
export function dxfPolygon(p: Polygon, m: Material, parentPos: Vec3, parentRot: Vec3, handleRef: {handle: number}): string {
7+
export function dxfPolygon(p: Polygon, m: Material, parentPos: Vec3, parentRot: Vec3, handleRef: Handle): string {
88
let polygonString = "";
99
const pos = vec3TransRot(p.pos, parentPos, parentRot);
1010
const rot = vec3RotCombine(parentRot, p.rot ?? vec3Zero);
1111
const points = p.points.map((p) => vec3TransRot(p, pos, rot));
1212
let i = 0;
1313
if (points.length >= chunkSize) {
1414
for (i; i < points.length; i += chunkSize) {
15-
polygonString += dxf3DFACE(points[i]!, points[i + 1]!, points[i + 2]!, points[i + 3]!, color(m.normal), handleRef);
15+
polygonString += dxf3DFACE(
16+
points[i]!,
17+
points[i + 1]!,
18+
points[i + 2]!,
19+
points[i + 3]!,
20+
color(m.normal),
21+
handleRef
22+
);
1623
}
1724
}
1825

@@ -23,10 +30,24 @@ export function dxfPolygon(p: Polygon, m: Material, parentPos: Vec3, parentRot:
2330
polygonString += dxf3DFACE(points[i - 2]!, points[i - 1]!, points[i]!, points[i]!, color(m.normal), handleRef);
2431
break;
2532
case 2:
26-
polygonString += dxf3DFACE(points[i - 1]!, points[i]!, points[i + 1]!, points[i + 1]!, color(m.normal), handleRef);
33+
polygonString += dxf3DFACE(
34+
points[i - 1]!,
35+
points[i]!,
36+
points[i + 1]!,
37+
points[i + 1]!,
38+
color(m.normal),
39+
handleRef
40+
);
2741
break;
2842
case 3:
29-
polygonString += dxf3DFACE(points[i]!, points[i + 1]!, points[i + 2]!, points[i + 2]!, color(m.normal), handleRef);
43+
polygonString += dxf3DFACE(
44+
points[i]!,
45+
points[i + 1]!,
46+
points[i + 2]!,
47+
points[i + 2]!,
48+
color(m.normal),
49+
handleRef
50+
);
3051
break;
3152
default:
3253
break;

packages/abstract-3d/src/renderers/dxf/dxf-geometries/dxf-shape.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Shape, Material, Vec3, vec3TransRot, vec3RotCombine, vec3Zero, vec3 } from "../../../abstract-3d.js";
22
import { color } from "../color.js";
3-
import { dxf3DFACE } from "../dxf-encoding.js";
3+
import { dxf3DFACE, Handle } from "../dxf-encoding.js";
44

55
const chunkSize = 4;
66

7-
export function dxfPolygon(s: Shape, m: Material, parentPos: Vec3, parentRot: Vec3, handleRef: {handle: number}): string {
7+
export function dxfPolygon(s: Shape, m: Material, parentPos: Vec3, parentRot: Vec3, handleRef: Handle): string {
88
let polygonString = "";
99
const pos = vec3TransRot(s.pos, parentPos, parentRot);
1010
const rot = vec3RotCombine(parentRot, s.rot ?? vec3Zero);

0 commit comments

Comments
 (0)