@tscircuit/cli 0.1.1380 → 0.1.1381
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/build/build.worker.js +155 -217
- package/dist/cli/main.js +161 -223
- package/dist/lib/index.js +2 -2
- package/package.json +2 -2
|
@@ -13754,7 +13754,7 @@ function normalizeStepNumericExponents(stepText) {
|
|
|
13754
13754
|
var package_default = {
|
|
13755
13755
|
name: "circuit-json-to-step",
|
|
13756
13756
|
main: "dist/index.js",
|
|
13757
|
-
version: "0.0.
|
|
13757
|
+
version: "0.0.31",
|
|
13758
13758
|
type: "module",
|
|
13759
13759
|
scripts: {
|
|
13760
13760
|
"pull-reference": `git clone https://github.com/tscircuit/circuit-json.git && find circuit-json/tests -name '*.test.ts' -exec bash -c 'mv "$0" "\${0%.test.ts}.ts"' {} \\; && git clone https://github.com/tscircuit/stepts.git && find stepts/tests -name '*.test.ts' -exec bash -c 'mv "$0" "\${0%.test.ts}.ts"' {} \\;`,
|
|
@@ -13822,6 +13822,25 @@ function rotatePoint(x, y, centerX, centerY, angle) {
|
|
|
13822
13822
|
y: centerY + dx * sin + dy * cos
|
|
13823
13823
|
};
|
|
13824
13824
|
}
|
|
13825
|
+
function createVertexAt(repo, x, y, z) {
|
|
13826
|
+
return repo.add(new VertexPoint("", repo.add(new CartesianPoint("", x, y, z))));
|
|
13827
|
+
}
|
|
13828
|
+
function createVertexCache(repo, z) {
|
|
13829
|
+
const vertices = /* @__PURE__ */ new Map;
|
|
13830
|
+
const normalize = (value) => {
|
|
13831
|
+
const rounded = Number(value.toFixed(9));
|
|
13832
|
+
return Object.is(rounded, -0) ? 0 : rounded;
|
|
13833
|
+
};
|
|
13834
|
+
return (x, y) => {
|
|
13835
|
+
const key = `${normalize(x)},${normalize(y)},${normalize(z)}`;
|
|
13836
|
+
const existing = vertices.get(key);
|
|
13837
|
+
if (existing)
|
|
13838
|
+
return existing;
|
|
13839
|
+
const vertex = createVertexAt(repo, x, y, z);
|
|
13840
|
+
vertices.set(key, vertex);
|
|
13841
|
+
return vertex;
|
|
13842
|
+
};
|
|
13843
|
+
}
|
|
13825
13844
|
function createLineEdge(repo, v1, v2) {
|
|
13826
13845
|
const p1 = v1.resolve(repo).pnt.resolve(repo);
|
|
13827
13846
|
const p2 = v2.resolve(repo).pnt.resolve(repo);
|
|
@@ -13840,72 +13859,38 @@ function createLineEdge(repo, v1, v2) {
|
|
|
13840
13859
|
const line = repo.add(new Line("", v1.resolve(repo).pnt, vec));
|
|
13841
13860
|
return repo.add(new EdgeCurve("", v1, v2, line, true));
|
|
13842
13861
|
}
|
|
13843
|
-
function
|
|
13844
|
-
const
|
|
13845
|
-
const
|
|
13846
|
-
|
|
13847
|
-
|
|
13848
|
-
|
|
13849
|
-
|
|
13850
|
-
|
|
13851
|
-
|
|
13852
|
-
|
|
13853
|
-
|
|
13862
|
+
function createLineSegment(repo, start, end, getVertex) {
|
|
13863
|
+
const startVertex = getVertex(start.x, start.y);
|
|
13864
|
+
const endVertex = getVertex(end.x, end.y);
|
|
13865
|
+
return {
|
|
13866
|
+
kind: "line",
|
|
13867
|
+
edge: createLineEdge(repo, startVertex, endVertex),
|
|
13868
|
+
start: startVertex,
|
|
13869
|
+
end: endVertex
|
|
13870
|
+
};
|
|
13871
|
+
}
|
|
13872
|
+
function createArcSegment(repo, centerX, centerY, z, radius, startAngle, endAngle, rotation, centerX0, centerY0, getVertex) {
|
|
13873
|
+
const start = rotatePoint(centerX + radius * Math.cos(startAngle), centerY + radius * Math.sin(startAngle), centerX0, centerY0, rotation);
|
|
13874
|
+
const end = rotatePoint(centerX + radius * Math.cos(endAngle), centerY + radius * Math.sin(endAngle), centerX0, centerY0, rotation);
|
|
13875
|
+
const center = rotatePoint(centerX, centerY, centerX0, centerY0, rotation);
|
|
13876
|
+
const startVertex = getVertex(start.x, start.y);
|
|
13877
|
+
const endVertex = getVertex(end.x, end.y);
|
|
13878
|
+
const centerPoint = repo.add(new CartesianPoint("", center.x, center.y, z));
|
|
13854
13879
|
const normalDir = repo.add(new Direction("", 0, 0, -1));
|
|
13855
|
-
const
|
|
13856
|
-
const refDir = repo.add(new Direction("", Math.cos(refAngle), Math.sin(refAngle), 0));
|
|
13880
|
+
const refDir = repo.add(new Direction("", Math.cos(rotation), Math.sin(rotation), 0));
|
|
13857
13881
|
const placement = repo.add(new Axis2Placement3D("", centerPoint, normalDir, refDir));
|
|
13858
13882
|
const circle = repo.add(new Circle("", placement, radius));
|
|
13859
|
-
return
|
|
13860
|
-
|
|
13861
|
-
|
|
13862
|
-
|
|
13863
|
-
|
|
13883
|
+
return {
|
|
13884
|
+
kind: "arc",
|
|
13885
|
+
edge: repo.add(new EdgeCurve("", startVertex, endVertex, circle, false)),
|
|
13886
|
+
start: startVertex,
|
|
13887
|
+
end: endVertex,
|
|
13864
13888
|
centerX,
|
|
13865
13889
|
centerY,
|
|
13866
|
-
radius
|
|
13867
|
-
|
|
13868
|
-
rotation,
|
|
13869
|
-
isHorizontal
|
|
13870
|
-
} = geom;
|
|
13871
|
-
const edges = [];
|
|
13872
|
-
if (isHorizontal) {
|
|
13873
|
-
const capOffset = straightHalfLength;
|
|
13874
|
-
const rightArc = createArcEdge(repo, centerX + capOffset, centerY, z, radius, -Math.PI / 2, Math.PI / 2, rotation, centerX, centerY);
|
|
13875
|
-
edges.push(rightArc);
|
|
13876
|
-
const bottomStart = rotatePoint(centerX + capOffset, centerY - radius, centerX, centerY, rotation);
|
|
13877
|
-
const bottomEnd = rotatePoint(centerX - capOffset, centerY - radius, centerX, centerY, rotation);
|
|
13878
|
-
const bottomV1 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", bottomStart.x, bottomStart.y, z))));
|
|
13879
|
-
const bottomV2 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", bottomEnd.x, bottomEnd.y, z))));
|
|
13880
|
-
edges.push(createLineEdge(repo, bottomV1, bottomV2));
|
|
13881
|
-
const leftArc = createArcEdge(repo, centerX - capOffset, centerY, z, radius, Math.PI / 2, 3 * Math.PI / 2, rotation, centerX, centerY);
|
|
13882
|
-
edges.push(leftArc);
|
|
13883
|
-
const topStart = rotatePoint(centerX - capOffset, centerY + radius, centerX, centerY, rotation);
|
|
13884
|
-
const topEnd = rotatePoint(centerX + capOffset, centerY + radius, centerX, centerY, rotation);
|
|
13885
|
-
const topV1 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", topStart.x, topStart.y, z))));
|
|
13886
|
-
const topV2 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", topEnd.x, topEnd.y, z))));
|
|
13887
|
-
edges.push(createLineEdge(repo, topV1, topV2));
|
|
13888
|
-
} else {
|
|
13889
|
-
const capOffset = straightHalfLength;
|
|
13890
|
-
const topArc = createArcEdge(repo, centerX, centerY - capOffset, z, radius, Math.PI, 0, rotation, centerX, centerY);
|
|
13891
|
-
edges.push(topArc);
|
|
13892
|
-
const rightStart = rotatePoint(centerX + radius, centerY - capOffset, centerX, centerY, rotation);
|
|
13893
|
-
const rightEnd = rotatePoint(centerX + radius, centerY + capOffset, centerX, centerY, rotation);
|
|
13894
|
-
const rightV1 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", rightStart.x, rightStart.y, z))));
|
|
13895
|
-
const rightV2 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", rightEnd.x, rightEnd.y, z))));
|
|
13896
|
-
edges.push(createLineEdge(repo, rightV1, rightV2));
|
|
13897
|
-
const bottomArc = createArcEdge(repo, centerX, centerY + capOffset, z, radius, 0, Math.PI, rotation, centerX, centerY);
|
|
13898
|
-
edges.push(bottomArc);
|
|
13899
|
-
const leftStart = rotatePoint(centerX - radius, centerY + capOffset, centerX, centerY, rotation);
|
|
13900
|
-
const leftEnd = rotatePoint(centerX - radius, centerY - capOffset, centerX, centerY, rotation);
|
|
13901
|
-
const leftV1 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", leftStart.x, leftStart.y, z))));
|
|
13902
|
-
const leftV2 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", leftEnd.x, leftEnd.y, z))));
|
|
13903
|
-
edges.push(createLineEdge(repo, leftV1, leftV2));
|
|
13904
|
-
}
|
|
13905
|
-
const orientedEdges = edges.map((edge) => repo.add(new OrientedEdge("", edge, true)));
|
|
13906
|
-
return repo.add(new EdgeLoop("", orientedEdges));
|
|
13890
|
+
radius
|
|
13891
|
+
};
|
|
13907
13892
|
}
|
|
13908
|
-
function
|
|
13893
|
+
function createPillBoundarySegments(repo, hole, z) {
|
|
13909
13894
|
const geom = getPillGeometry(hole);
|
|
13910
13895
|
const {
|
|
13911
13896
|
centerX,
|
|
@@ -13915,103 +13900,75 @@ function createPillCylindricalFaces(repo, hole, zMin, zMax, xDir, zDir) {
|
|
|
13915
13900
|
rotation,
|
|
13916
13901
|
isHorizontal
|
|
13917
13902
|
} = geom;
|
|
13918
|
-
const
|
|
13903
|
+
const capOffset = straightHalfLength;
|
|
13904
|
+
const getVertex = createVertexCache(repo, z);
|
|
13919
13905
|
if (isHorizontal) {
|
|
13920
|
-
|
|
13921
|
-
|
|
13922
|
-
|
|
13923
|
-
|
|
13924
|
-
|
|
13925
|
-
|
|
13926
|
-
const capOffset = straightHalfLength;
|
|
13927
|
-
faces.push(createCylindricalWall(repo, centerX, centerY - capOffset, radius, Math.PI, 0, rotation, centerX, centerY, zMin, zMax, zDir, xDir));
|
|
13928
|
-
faces.push(createPlanarWall(repo, centerX + radius, centerY - capOffset, centerX + radius, centerY + capOffset, rotation, centerX, centerY, zMin, zMax, zDir));
|
|
13929
|
-
faces.push(createCylindricalWall(repo, centerX, centerY + capOffset, radius, 0, Math.PI, rotation, centerX, centerY, zMin, zMax, zDir, xDir));
|
|
13930
|
-
faces.push(createPlanarWall(repo, centerX - radius, centerY + capOffset, centerX - radius, centerY - capOffset, rotation, centerX, centerY, zMin, zMax, zDir));
|
|
13906
|
+
return [
|
|
13907
|
+
createArcSegment(repo, centerX + capOffset, centerY, z, radius, -Math.PI / 2, Math.PI / 2, rotation, centerX, centerY, getVertex),
|
|
13908
|
+
createLineSegment(repo, rotatePoint(centerX + capOffset, centerY - radius, centerX, centerY, rotation), rotatePoint(centerX - capOffset, centerY - radius, centerX, centerY, rotation), getVertex),
|
|
13909
|
+
createArcSegment(repo, centerX - capOffset, centerY, z, radius, Math.PI / 2, 3 * Math.PI / 2, rotation, centerX, centerY, getVertex),
|
|
13910
|
+
createLineSegment(repo, rotatePoint(centerX - capOffset, centerY + radius, centerX, centerY, rotation), rotatePoint(centerX + capOffset, centerY + radius, centerX, centerY, rotation), getVertex)
|
|
13911
|
+
];
|
|
13931
13912
|
}
|
|
13932
|
-
return
|
|
13913
|
+
return [
|
|
13914
|
+
createArcSegment(repo, centerX, centerY - capOffset, z, radius, Math.PI, 0, rotation, centerX, centerY, getVertex),
|
|
13915
|
+
createLineSegment(repo, rotatePoint(centerX + radius, centerY - capOffset, centerX, centerY, rotation), rotatePoint(centerX + radius, centerY + capOffset, centerX, centerY, rotation), getVertex),
|
|
13916
|
+
createArcSegment(repo, centerX, centerY + capOffset, z, radius, 0, Math.PI, rotation, centerX, centerY, getVertex),
|
|
13917
|
+
createLineSegment(repo, rotatePoint(centerX - radius, centerY + capOffset, centerX, centerY, rotation), rotatePoint(centerX - radius, centerY - capOffset, centerX, centerY, rotation), getVertex)
|
|
13918
|
+
];
|
|
13933
13919
|
}
|
|
13934
|
-
function
|
|
13935
|
-
|
|
13936
|
-
const bottomStartY = centerY + radius * Math.sin(startAngle);
|
|
13937
|
-
const bottomEndX = centerX + radius * Math.cos(endAngle);
|
|
13938
|
-
const bottomEndY = centerY + radius * Math.sin(endAngle);
|
|
13939
|
-
const bottomStart = rotatePoint(bottomStartX, bottomStartY, centerX0, centerY0, rotation);
|
|
13940
|
-
const bottomEnd = rotatePoint(bottomEndX, bottomEndY, centerX0, centerY0, rotation);
|
|
13941
|
-
const bottomStartVertex = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", bottomStart.x, bottomStart.y, zMin))));
|
|
13942
|
-
const bottomEndVertex = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", bottomEnd.x, bottomEnd.y, zMin))));
|
|
13943
|
-
const topStart = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", bottomStart.x, bottomStart.y, zMax))));
|
|
13944
|
-
const topEnd = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", bottomEnd.x, bottomEnd.y, zMax))));
|
|
13945
|
-
const centerRotated = rotatePoint(centerX, centerY, centerX0, centerY0, rotation);
|
|
13946
|
-
const bottomCenter = repo.add(new CartesianPoint("", centerRotated.x, centerRotated.y, zMin));
|
|
13947
|
-
const bottomPlacement = repo.add(new Axis2Placement3D("", bottomCenter, repo.add(new Direction("", 0, 0, -1)), xDir));
|
|
13948
|
-
const bottomCircle = repo.add(new Circle("", bottomPlacement, radius));
|
|
13949
|
-
const bottomArc = repo.add(new EdgeCurve("", bottomStartVertex, bottomEndVertex, bottomCircle, false));
|
|
13950
|
-
const topCenter = repo.add(new CartesianPoint("", centerRotated.x, centerRotated.y, zMax));
|
|
13951
|
-
const topPlacement = repo.add(new Axis2Placement3D("", topCenter, zDir, xDir));
|
|
13952
|
-
const topCircle = repo.add(new Circle("", topPlacement, radius));
|
|
13953
|
-
const topArc = repo.add(new EdgeCurve("", topEnd, topStart, topCircle, false));
|
|
13954
|
-
const v1 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", bottomStart.x, bottomStart.y, zMin))));
|
|
13955
|
-
const v2 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", bottomStart.x, bottomStart.y, zMax))));
|
|
13956
|
-
const v3 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", bottomEnd.x, bottomEnd.y, zMin))));
|
|
13957
|
-
const v4 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", bottomEnd.x, bottomEnd.y, zMax))));
|
|
13958
|
-
const dir1 = repo.add(new Direction("", 0, 0, 1));
|
|
13959
|
-
const height = zMax - zMin;
|
|
13960
|
-
const vec1 = repo.add(new Vector("", dir1, height));
|
|
13961
|
-
const line1 = repo.add(new Line("", v1.resolve(repo).pnt, vec1));
|
|
13962
|
-
const edge1 = repo.add(new EdgeCurve("", v1, v2, line1, true));
|
|
13963
|
-
const dir2 = repo.add(new Direction("", 0, 0, 1));
|
|
13964
|
-
const vec2 = repo.add(new Vector("", dir2, height));
|
|
13965
|
-
const line2 = repo.add(new Line("", v3.resolve(repo).pnt, vec2));
|
|
13966
|
-
const edge2 = repo.add(new EdgeCurve("", v3, v4, line2, true));
|
|
13967
|
-
const loop = repo.add(new EdgeLoop("", [
|
|
13968
|
-
repo.add(new OrientedEdge("", bottomArc, true)),
|
|
13969
|
-
repo.add(new OrientedEdge("", edge2, true)),
|
|
13970
|
-
repo.add(new OrientedEdge("", topArc, false)),
|
|
13971
|
-
repo.add(new OrientedEdge("", edge1, false))
|
|
13972
|
-
]));
|
|
13973
|
-
const cylinderPlacement = repo.add(new Axis2Placement3D("", bottomCenter, zDir, xDir));
|
|
13974
|
-
const cylinderSurface = repo.add(new CylindricalSurface("", cylinderPlacement, radius));
|
|
13975
|
-
return repo.add(new AdvancedFace("", [repo.add(new FaceOuterBound("", loop, true))], cylinderSurface, false));
|
|
13920
|
+
function createLoopFromSegments(repo, segments, orientation) {
|
|
13921
|
+
return repo.add(new EdgeLoop("", segments.map((segment) => repo.add(new OrientedEdge("", segment.edge, orientation)))));
|
|
13976
13922
|
}
|
|
13977
|
-
function
|
|
13978
|
-
const
|
|
13979
|
-
const
|
|
13980
|
-
const
|
|
13981
|
-
const
|
|
13982
|
-
const
|
|
13983
|
-
const
|
|
13984
|
-
const
|
|
13985
|
-
const
|
|
13986
|
-
|
|
13987
|
-
|
|
13988
|
-
|
|
13989
|
-
|
|
13990
|
-
|
|
13991
|
-
|
|
13992
|
-
|
|
13993
|
-
|
|
13994
|
-
|
|
13995
|
-
|
|
13996
|
-
|
|
13997
|
-
|
|
13998
|
-
|
|
13999
|
-
|
|
14000
|
-
|
|
14001
|
-
|
|
14002
|
-
|
|
14003
|
-
|
|
14004
|
-
|
|
14005
|
-
|
|
14006
|
-
|
|
14007
|
-
|
|
14008
|
-
|
|
14009
|
-
|
|
14010
|
-
|
|
14011
|
-
|
|
14012
|
-
|
|
14013
|
-
|
|
14014
|
-
|
|
13923
|
+
function createPillHoleGeometry(repo, hole, zMin, zMax, zDir) {
|
|
13924
|
+
const geom = getPillGeometry(hole);
|
|
13925
|
+
const bottomSegments = createPillBoundarySegments(repo, hole, zMin);
|
|
13926
|
+
const topSegments = createPillBoundarySegments(repo, hole, zMax);
|
|
13927
|
+
const bottomLoop = createLoopFromSegments(repo, bottomSegments, true);
|
|
13928
|
+
const topLoop = createLoopFromSegments(repo, topSegments, true);
|
|
13929
|
+
const wallFaces = [];
|
|
13930
|
+
const verticalEdges = /* @__PURE__ */ new Map;
|
|
13931
|
+
const getVerticalEdge = (bottomVertex, topVertex) => {
|
|
13932
|
+
const key = `${bottomVertex.id}:${topVertex.id}`;
|
|
13933
|
+
const existing = verticalEdges.get(key);
|
|
13934
|
+
if (existing)
|
|
13935
|
+
return existing;
|
|
13936
|
+
const edge = createLineEdge(repo, bottomVertex, topVertex);
|
|
13937
|
+
verticalEdges.set(key, edge);
|
|
13938
|
+
return edge;
|
|
13939
|
+
};
|
|
13940
|
+
for (let i = 0;i < bottomSegments.length; i++) {
|
|
13941
|
+
const bottomSegment = bottomSegments[i];
|
|
13942
|
+
const topSegment = topSegments[i];
|
|
13943
|
+
const startVertical = getVerticalEdge(bottomSegment.start, topSegment.start);
|
|
13944
|
+
const endVertical = getVerticalEdge(bottomSegment.end, topSegment.end);
|
|
13945
|
+
const loop = repo.add(new EdgeLoop("", [
|
|
13946
|
+
repo.add(new OrientedEdge("", bottomSegment.edge, true)),
|
|
13947
|
+
repo.add(new OrientedEdge("", endVertical, true)),
|
|
13948
|
+
repo.add(new OrientedEdge("", topSegment.edge, false)),
|
|
13949
|
+
repo.add(new OrientedEdge("", startVertical, false))
|
|
13950
|
+
]));
|
|
13951
|
+
if (bottomSegment.kind === "arc") {
|
|
13952
|
+
const center = rotatePoint(bottomSegment.centerX, bottomSegment.centerY, geom.centerX, geom.centerY, geom.rotation);
|
|
13953
|
+
const bottomCenter = repo.add(new CartesianPoint("", center.x, center.y, zMin));
|
|
13954
|
+
const refDir2 = repo.add(new Direction("", Math.cos(geom.rotation), Math.sin(geom.rotation), 0));
|
|
13955
|
+
const cylinderPlacement = repo.add(new Axis2Placement3D("", bottomCenter, zDir, refDir2));
|
|
13956
|
+
const cylinderSurface = repo.add(new CylindricalSurface("", cylinderPlacement, bottomSegment.radius));
|
|
13957
|
+
wallFaces.push(repo.add(new AdvancedFace("", [repo.add(new FaceOuterBound("", loop, true))], cylinderSurface, false)));
|
|
13958
|
+
continue;
|
|
13959
|
+
}
|
|
13960
|
+
const startPoint = bottomSegment.start.resolve(repo).pnt.resolve(repo);
|
|
13961
|
+
const endPoint = bottomSegment.end.resolve(repo).pnt.resolve(repo);
|
|
13962
|
+
const dx = endPoint.x - startPoint.x;
|
|
13963
|
+
const dy = endPoint.y - startPoint.y;
|
|
13964
|
+
const edgeLength = Math.sqrt(dx * dx + dy * dy);
|
|
13965
|
+
const normalDir = repo.add(new Direction("", dy / edgeLength, -dx / edgeLength, 0));
|
|
13966
|
+
const refDir = repo.add(new Direction("", dx / edgeLength, dy / edgeLength, 0));
|
|
13967
|
+
const placement = repo.add(new Axis2Placement3D("", bottomSegment.start.resolve(repo).pnt, normalDir, refDir));
|
|
13968
|
+
const plane = repo.add(new Plane("", placement));
|
|
13969
|
+
wallFaces.push(repo.add(new AdvancedFace("", [repo.add(new FaceOuterBound("", loop, true))], plane, true)));
|
|
13970
|
+
}
|
|
13971
|
+
return { bottomLoop, topLoop, wallFaces };
|
|
14015
13972
|
}
|
|
14016
13973
|
async function circuitJsonToStep(circuitJson, options = {}) {
|
|
14017
13974
|
const repo = new Repository;
|
|
@@ -14147,50 +14104,61 @@ async function circuitJsonToStep(circuitJson, options = {}) {
|
|
|
14147
14104
|
const bottomFrame = repo.add(new Axis2Placement3D("", origin, repo.add(new Direction("", 0, 0, -1)), xDir));
|
|
14148
14105
|
const bottomPlane = repo.add(new Plane("", bottomFrame));
|
|
14149
14106
|
const bottomLoop = repo.add(new EdgeLoop("", bottomEdges.map((edge) => repo.add(new OrientedEdge("", edge, true)))));
|
|
14150
|
-
const bottomHoleLoops = [];
|
|
14151
|
-
for (const hole of holes) {
|
|
14152
|
-
const holeShape = hole.hole_shape ?? hole.shape;
|
|
14153
|
-
if (holeShape === "circle") {
|
|
14154
|
-
const holeX = typeof hole.x === "number" ? hole.x : hole.x ?? 0;
|
|
14155
|
-
const holeY = typeof hole.y === "number" ? hole.y : hole.y ?? 0;
|
|
14156
|
-
const radius = (hole.hole_diameter ?? 0) / 2;
|
|
14157
|
-
const holeCenter = repo.add(new CartesianPoint("", holeX, holeY, -halfBoardThickness));
|
|
14158
|
-
const holeVertex = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", holeX + radius, holeY, -halfBoardThickness))));
|
|
14159
|
-
const holePlacement = repo.add(new Axis2Placement3D("", holeCenter, repo.add(new Direction("", 0, 0, -1)), xDir));
|
|
14160
|
-
const holeCircle = repo.add(new Circle("", holePlacement, radius));
|
|
14161
|
-
const holeEdge = repo.add(new EdgeCurve("", holeVertex, holeVertex, holeCircle, true));
|
|
14162
|
-
const holeLoop = repo.add(new EdgeLoop("", [repo.add(new OrientedEdge("", holeEdge, false))]));
|
|
14163
|
-
bottomHoleLoops.push(repo.add(new FaceBound("", holeLoop, true)));
|
|
14164
|
-
} else if (holeShape === "rotated_pill" || holeShape === "pill") {
|
|
14165
|
-
const pillLoop = createPillHoleLoop(repo, hole, -halfBoardThickness, xDir);
|
|
14166
|
-
bottomHoleLoops.push(repo.add(new FaceBound("", pillLoop, true)));
|
|
14167
|
-
}
|
|
14168
|
-
}
|
|
14169
|
-
const bottomFace = repo.add(new AdvancedFace("", [repo.add(new FaceOuterBound("", bottomLoop, true)), ...bottomHoleLoops], bottomPlane, true));
|
|
14170
14107
|
const topOrigin = repo.add(new CartesianPoint("", 0, 0, halfBoardThickness));
|
|
14171
14108
|
const topFrame = repo.add(new Axis2Placement3D("", topOrigin, zDir, xDir));
|
|
14172
14109
|
const topPlane = repo.add(new Plane("", topFrame));
|
|
14173
14110
|
const topLoop = repo.add(new EdgeLoop("", topEdges.map((edge) => repo.add(new OrientedEdge("", edge, false)))));
|
|
14174
|
-
|
|
14111
|
+
function getHoleCoordinate(coordinate) {
|
|
14112
|
+
if (typeof coordinate === "number")
|
|
14113
|
+
return coordinate;
|
|
14114
|
+
return coordinate?.value ?? 0;
|
|
14115
|
+
}
|
|
14116
|
+
function createCircularHoleGeometry(hole) {
|
|
14117
|
+
const holeX = getHoleCoordinate(hole.x);
|
|
14118
|
+
const holeY = getHoleCoordinate(hole.y);
|
|
14119
|
+
const radius = (hole.hole_diameter ?? 0) / 2;
|
|
14120
|
+
const bottomHoleCenter = repo.add(new CartesianPoint("", holeX, holeY, -halfBoardThickness));
|
|
14121
|
+
const bottomHoleVertex = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", holeX + radius, holeY, -halfBoardThickness))));
|
|
14122
|
+
const bottomHolePlacement = repo.add(new Axis2Placement3D("", bottomHoleCenter, repo.add(new Direction("", 0, 0, -1)), xDir));
|
|
14123
|
+
const bottomHoleCircle = repo.add(new Circle("", bottomHolePlacement, radius));
|
|
14124
|
+
const bottomHoleEdge = repo.add(new EdgeCurve("", bottomHoleVertex, bottomHoleVertex, bottomHoleCircle, true));
|
|
14125
|
+
const topHoleCenter = repo.add(new CartesianPoint("", holeX, holeY, halfBoardThickness));
|
|
14126
|
+
const topHoleVertex = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", holeX + radius, holeY, halfBoardThickness))));
|
|
14127
|
+
const topHolePlacement = repo.add(new Axis2Placement3D("", topHoleCenter, zDir, xDir));
|
|
14128
|
+
const topHoleCircle = repo.add(new Circle("", topHolePlacement, radius));
|
|
14129
|
+
const topHoleEdge = repo.add(new EdgeCurve("", topHoleVertex, topHoleVertex, topHoleCircle, true));
|
|
14130
|
+
const bottomLoop2 = repo.add(new EdgeLoop("", [repo.add(new OrientedEdge("", bottomHoleEdge, false))]));
|
|
14131
|
+
const topLoop2 = repo.add(new EdgeLoop("", [repo.add(new OrientedEdge("", topHoleEdge, true))]));
|
|
14132
|
+
const wallLoop = repo.add(new EdgeLoop("", [
|
|
14133
|
+
repo.add(new OrientedEdge("", bottomHoleEdge, true)),
|
|
14134
|
+
repo.add(new OrientedEdge("", topHoleEdge, false))
|
|
14135
|
+
]));
|
|
14136
|
+
const holeCylinderPlacement = repo.add(new Axis2Placement3D("", bottomHoleCenter, zDir, xDir));
|
|
14137
|
+
const holeCylinderSurface = repo.add(new CylindricalSurface("", holeCylinderPlacement, radius));
|
|
14138
|
+
const wallFace = repo.add(new AdvancedFace("", [repo.add(new FaceOuterBound("", wallLoop, true))], holeCylinderSurface, false));
|
|
14139
|
+
return { bottomLoop: bottomLoop2, topLoop: topLoop2, wallFaces: [wallFace] };
|
|
14140
|
+
}
|
|
14141
|
+
const sharedHoleGeometries = [];
|
|
14175
14142
|
for (const hole of holes) {
|
|
14176
14143
|
const holeShape = hole.hole_shape ?? hole.shape;
|
|
14177
14144
|
if (holeShape === "circle") {
|
|
14178
|
-
|
|
14179
|
-
const holeY = typeof hole.y === "number" ? hole.y : hole.y ?? 0;
|
|
14180
|
-
const radius = (hole.hole_diameter ?? 0) / 2;
|
|
14181
|
-
const holeCenter = repo.add(new CartesianPoint("", holeX, holeY, halfBoardThickness));
|
|
14182
|
-
const holeVertex = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", holeX + radius, holeY, halfBoardThickness))));
|
|
14183
|
-
const holePlacement = repo.add(new Axis2Placement3D("", holeCenter, zDir, xDir));
|
|
14184
|
-
const holeCircle = repo.add(new Circle("", holePlacement, radius));
|
|
14185
|
-
const holeEdge = repo.add(new EdgeCurve("", holeVertex, holeVertex, holeCircle, true));
|
|
14186
|
-
const holeLoop = repo.add(new EdgeLoop("", [repo.add(new OrientedEdge("", holeEdge, true))]));
|
|
14187
|
-
topHoleLoops.push(repo.add(new FaceBound("", holeLoop, true)));
|
|
14145
|
+
sharedHoleGeometries.push(createCircularHoleGeometry(hole));
|
|
14188
14146
|
} else if (holeShape === "rotated_pill" || holeShape === "pill") {
|
|
14189
|
-
|
|
14190
|
-
topHoleLoops.push(repo.add(new FaceBound("", pillLoop, true)));
|
|
14147
|
+
sharedHoleGeometries.push(createPillHoleGeometry(repo, hole, -halfBoardThickness, halfBoardThickness, zDir));
|
|
14191
14148
|
}
|
|
14192
14149
|
}
|
|
14150
|
+
const bottomHoleLoops = [];
|
|
14151
|
+
const topHoleLoops = [];
|
|
14152
|
+
for (const holeGeometry of sharedHoleGeometries) {
|
|
14153
|
+
bottomHoleLoops.push(repo.add(new FaceBound("", holeGeometry.bottomLoop, true)));
|
|
14154
|
+
topHoleLoops.push(repo.add(new FaceBound("", holeGeometry.topLoop, true)));
|
|
14155
|
+
}
|
|
14156
|
+
const bottomFace = repo.add(new AdvancedFace("", [repo.add(new FaceOuterBound("", bottomLoop, true)), ...bottomHoleLoops], bottomPlane, true));
|
|
14193
14157
|
const topFace = repo.add(new AdvancedFace("", [repo.add(new FaceOuterBound("", topLoop, true)), ...topHoleLoops], topPlane, true));
|
|
14158
|
+
const holeCylindricalFaces = [];
|
|
14159
|
+
for (const holeGeometry of sharedHoleGeometries) {
|
|
14160
|
+
holeCylindricalFaces.push(...holeGeometry.wallFaces);
|
|
14161
|
+
}
|
|
14194
14162
|
const sideFaces = [];
|
|
14195
14163
|
for (let i = 0;i < bottomEdges.length; i++) {
|
|
14196
14164
|
const nextI = (i + 1) % bottomEdges.length;
|
|
@@ -14216,36 +14184,6 @@ async function circuitJsonToStep(circuitJson, options = {}) {
|
|
|
14216
14184
|
const sideFace = repo.add(new AdvancedFace("", [repo.add(new FaceOuterBound("", sideLoop, true))], sidePlane, true));
|
|
14217
14185
|
sideFaces.push(sideFace);
|
|
14218
14186
|
}
|
|
14219
|
-
const holeCylindricalFaces = [];
|
|
14220
|
-
for (const hole of holes) {
|
|
14221
|
-
const holeShape = hole.hole_shape ?? hole.shape;
|
|
14222
|
-
if (holeShape === "circle") {
|
|
14223
|
-
const holeX = typeof hole.x === "number" ? hole.x : hole.x ?? 0;
|
|
14224
|
-
const holeY = typeof hole.y === "number" ? hole.y : hole.y ?? 0;
|
|
14225
|
-
const radius = (hole.hole_diameter ?? 0) / 2;
|
|
14226
|
-
const bottomHoleCenter = repo.add(new CartesianPoint("", holeX, holeY, -halfBoardThickness));
|
|
14227
|
-
const bottomHoleVertex = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", holeX + radius, holeY, -halfBoardThickness))));
|
|
14228
|
-
const bottomHolePlacement = repo.add(new Axis2Placement3D("", bottomHoleCenter, repo.add(new Direction("", 0, 0, -1)), xDir));
|
|
14229
|
-
const bottomHoleCircle = repo.add(new Circle("", bottomHolePlacement, radius));
|
|
14230
|
-
const bottomHoleEdge = repo.add(new EdgeCurve("", bottomHoleVertex, bottomHoleVertex, bottomHoleCircle, true));
|
|
14231
|
-
const topHoleCenter = repo.add(new CartesianPoint("", holeX, holeY, halfBoardThickness));
|
|
14232
|
-
const topHoleVertex = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", holeX + radius, holeY, halfBoardThickness))));
|
|
14233
|
-
const topHolePlacement = repo.add(new Axis2Placement3D("", topHoleCenter, zDir, xDir));
|
|
14234
|
-
const topHoleCircle = repo.add(new Circle("", topHolePlacement, radius));
|
|
14235
|
-
const topHoleEdge = repo.add(new EdgeCurve("", topHoleVertex, topHoleVertex, topHoleCircle, true));
|
|
14236
|
-
const holeCylinderLoop = repo.add(new EdgeLoop("", [
|
|
14237
|
-
repo.add(new OrientedEdge("", bottomHoleEdge, true)),
|
|
14238
|
-
repo.add(new OrientedEdge("", topHoleEdge, false))
|
|
14239
|
-
]));
|
|
14240
|
-
const holeCylinderPlacement = repo.add(new Axis2Placement3D("", bottomHoleCenter, zDir, xDir));
|
|
14241
|
-
const holeCylinderSurface = repo.add(new CylindricalSurface("", holeCylinderPlacement, radius));
|
|
14242
|
-
const holeCylinderFace = repo.add(new AdvancedFace("", [repo.add(new FaceOuterBound("", holeCylinderLoop, true))], holeCylinderSurface, false));
|
|
14243
|
-
holeCylindricalFaces.push(holeCylinderFace);
|
|
14244
|
-
} else if (holeShape === "rotated_pill" || holeShape === "pill") {
|
|
14245
|
-
const pillFaces = createPillCylindricalFaces(repo, hole, -halfBoardThickness, halfBoardThickness, xDir, zDir);
|
|
14246
|
-
holeCylindricalFaces.push(...pillFaces);
|
|
14247
|
-
}
|
|
14248
|
-
}
|
|
14249
14187
|
const allFaces = [bottomFace, topFace, ...sideFaces, ...holeCylindricalFaces];
|
|
14250
14188
|
const styleCache = createStyleCache();
|
|
14251
14189
|
const boardStyledItems = createStyledItems(repo, {
|
package/dist/cli/main.js
CHANGED
|
@@ -100616,7 +100616,7 @@ var import_perfect_cli = __toESM2(require_dist2(), 1);
|
|
|
100616
100616
|
// lib/getVersion.ts
|
|
100617
100617
|
import { createRequire as createRequire2 } from "node:module";
|
|
100618
100618
|
// package.json
|
|
100619
|
-
var version = "0.1.
|
|
100619
|
+
var version = "0.1.1380";
|
|
100620
100620
|
var package_default = {
|
|
100621
100621
|
name: "@tscircuit/cli",
|
|
100622
100622
|
version,
|
|
@@ -100657,7 +100657,7 @@ var package_default = {
|
|
|
100657
100657
|
"circuit-json-to-pnp-csv": "^0.0.7",
|
|
100658
100658
|
"circuit-json-to-readable-netlist": "^0.0.15",
|
|
100659
100659
|
"circuit-json-to-spice": "^0.0.10",
|
|
100660
|
-
"circuit-json-to-step": "^0.0.
|
|
100660
|
+
"circuit-json-to-step": "^0.0.32",
|
|
100661
100661
|
"circuit-json-to-tscircuit": "^0.0.9",
|
|
100662
100662
|
"circuit-json-trace-length-analysis": "github:tscircuit/circuit-json-trace-length-analysis#2b44792a40df0ca83b6bfb6ac95ed5e35e7168b8",
|
|
100663
100663
|
commander: "^14.0.0",
|
|
@@ -112478,7 +112478,7 @@ function normalizeStepNumericExponents(stepText) {
|
|
|
112478
112478
|
var package_default2 = {
|
|
112479
112479
|
name: "circuit-json-to-step",
|
|
112480
112480
|
main: "dist/index.js",
|
|
112481
|
-
version: "0.0.
|
|
112481
|
+
version: "0.0.31",
|
|
112482
112482
|
type: "module",
|
|
112483
112483
|
scripts: {
|
|
112484
112484
|
"pull-reference": `git clone https://github.com/tscircuit/circuit-json.git && find circuit-json/tests -name '*.test.ts' -exec bash -c 'mv "$0" "\${0%.test.ts}.ts"' {} \\; && git clone https://github.com/tscircuit/stepts.git && find stepts/tests -name '*.test.ts' -exec bash -c 'mv "$0" "\${0%.test.ts}.ts"' {} \\;`,
|
|
@@ -112546,6 +112546,25 @@ function rotatePoint(x, y, centerX, centerY, angle) {
|
|
|
112546
112546
|
y: centerY + dx * sin + dy * cos
|
|
112547
112547
|
};
|
|
112548
112548
|
}
|
|
112549
|
+
function createVertexAt(repo, x, y, z2) {
|
|
112550
|
+
return repo.add(new VertexPoint("", repo.add(new CartesianPoint("", x, y, z2))));
|
|
112551
|
+
}
|
|
112552
|
+
function createVertexCache(repo, z2) {
|
|
112553
|
+
const vertices = /* @__PURE__ */ new Map;
|
|
112554
|
+
const normalize = (value) => {
|
|
112555
|
+
const rounded = Number(value.toFixed(9));
|
|
112556
|
+
return Object.is(rounded, -0) ? 0 : rounded;
|
|
112557
|
+
};
|
|
112558
|
+
return (x, y) => {
|
|
112559
|
+
const key = `${normalize(x)},${normalize(y)},${normalize(z2)}`;
|
|
112560
|
+
const existing = vertices.get(key);
|
|
112561
|
+
if (existing)
|
|
112562
|
+
return existing;
|
|
112563
|
+
const vertex = createVertexAt(repo, x, y, z2);
|
|
112564
|
+
vertices.set(key, vertex);
|
|
112565
|
+
return vertex;
|
|
112566
|
+
};
|
|
112567
|
+
}
|
|
112549
112568
|
function createLineEdge(repo, v1, v2) {
|
|
112550
112569
|
const p1 = v1.resolve(repo).pnt.resolve(repo);
|
|
112551
112570
|
const p2 = v2.resolve(repo).pnt.resolve(repo);
|
|
@@ -112564,72 +112583,38 @@ function createLineEdge(repo, v1, v2) {
|
|
|
112564
112583
|
const line = repo.add(new Line("", v1.resolve(repo).pnt, vec));
|
|
112565
112584
|
return repo.add(new EdgeCurve("", v1, v2, line, true));
|
|
112566
112585
|
}
|
|
112567
|
-
function
|
|
112568
|
-
const
|
|
112569
|
-
const
|
|
112570
|
-
|
|
112571
|
-
|
|
112572
|
-
|
|
112573
|
-
|
|
112574
|
-
|
|
112575
|
-
|
|
112576
|
-
|
|
112577
|
-
|
|
112586
|
+
function createLineSegment(repo, start, end, getVertex) {
|
|
112587
|
+
const startVertex = getVertex(start.x, start.y);
|
|
112588
|
+
const endVertex = getVertex(end.x, end.y);
|
|
112589
|
+
return {
|
|
112590
|
+
kind: "line",
|
|
112591
|
+
edge: createLineEdge(repo, startVertex, endVertex),
|
|
112592
|
+
start: startVertex,
|
|
112593
|
+
end: endVertex
|
|
112594
|
+
};
|
|
112595
|
+
}
|
|
112596
|
+
function createArcSegment(repo, centerX, centerY, z2, radius, startAngle, endAngle, rotation, centerX0, centerY0, getVertex) {
|
|
112597
|
+
const start = rotatePoint(centerX + radius * Math.cos(startAngle), centerY + radius * Math.sin(startAngle), centerX0, centerY0, rotation);
|
|
112598
|
+
const end = rotatePoint(centerX + radius * Math.cos(endAngle), centerY + radius * Math.sin(endAngle), centerX0, centerY0, rotation);
|
|
112599
|
+
const center = rotatePoint(centerX, centerY, centerX0, centerY0, rotation);
|
|
112600
|
+
const startVertex = getVertex(start.x, start.y);
|
|
112601
|
+
const endVertex = getVertex(end.x, end.y);
|
|
112602
|
+
const centerPoint = repo.add(new CartesianPoint("", center.x, center.y, z2));
|
|
112578
112603
|
const normalDir = repo.add(new Direction("", 0, 0, -1));
|
|
112579
|
-
const
|
|
112580
|
-
const refDir = repo.add(new Direction("", Math.cos(refAngle), Math.sin(refAngle), 0));
|
|
112604
|
+
const refDir = repo.add(new Direction("", Math.cos(rotation), Math.sin(rotation), 0));
|
|
112581
112605
|
const placement = repo.add(new Axis2Placement3D("", centerPoint, normalDir, refDir));
|
|
112582
112606
|
const circle = repo.add(new Circle("", placement, radius));
|
|
112583
|
-
return
|
|
112584
|
-
|
|
112585
|
-
|
|
112586
|
-
|
|
112587
|
-
|
|
112607
|
+
return {
|
|
112608
|
+
kind: "arc",
|
|
112609
|
+
edge: repo.add(new EdgeCurve("", startVertex, endVertex, circle, false)),
|
|
112610
|
+
start: startVertex,
|
|
112611
|
+
end: endVertex,
|
|
112588
112612
|
centerX,
|
|
112589
112613
|
centerY,
|
|
112590
|
-
radius
|
|
112591
|
-
|
|
112592
|
-
|
|
112593
|
-
|
|
112594
|
-
} = geom;
|
|
112595
|
-
const edges = [];
|
|
112596
|
-
if (isHorizontal) {
|
|
112597
|
-
const capOffset = straightHalfLength;
|
|
112598
|
-
const rightArc = createArcEdge(repo, centerX + capOffset, centerY, z2, radius, -Math.PI / 2, Math.PI / 2, rotation, centerX, centerY);
|
|
112599
|
-
edges.push(rightArc);
|
|
112600
|
-
const bottomStart = rotatePoint(centerX + capOffset, centerY - radius, centerX, centerY, rotation);
|
|
112601
|
-
const bottomEnd = rotatePoint(centerX - capOffset, centerY - radius, centerX, centerY, rotation);
|
|
112602
|
-
const bottomV1 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", bottomStart.x, bottomStart.y, z2))));
|
|
112603
|
-
const bottomV2 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", bottomEnd.x, bottomEnd.y, z2))));
|
|
112604
|
-
edges.push(createLineEdge(repo, bottomV1, bottomV2));
|
|
112605
|
-
const leftArc = createArcEdge(repo, centerX - capOffset, centerY, z2, radius, Math.PI / 2, 3 * Math.PI / 2, rotation, centerX, centerY);
|
|
112606
|
-
edges.push(leftArc);
|
|
112607
|
-
const topStart = rotatePoint(centerX - capOffset, centerY + radius, centerX, centerY, rotation);
|
|
112608
|
-
const topEnd = rotatePoint(centerX + capOffset, centerY + radius, centerX, centerY, rotation);
|
|
112609
|
-
const topV1 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", topStart.x, topStart.y, z2))));
|
|
112610
|
-
const topV2 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", topEnd.x, topEnd.y, z2))));
|
|
112611
|
-
edges.push(createLineEdge(repo, topV1, topV2));
|
|
112612
|
-
} else {
|
|
112613
|
-
const capOffset = straightHalfLength;
|
|
112614
|
-
const topArc = createArcEdge(repo, centerX, centerY - capOffset, z2, radius, Math.PI, 0, rotation, centerX, centerY);
|
|
112615
|
-
edges.push(topArc);
|
|
112616
|
-
const rightStart = rotatePoint(centerX + radius, centerY - capOffset, centerX, centerY, rotation);
|
|
112617
|
-
const rightEnd = rotatePoint(centerX + radius, centerY + capOffset, centerX, centerY, rotation);
|
|
112618
|
-
const rightV1 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", rightStart.x, rightStart.y, z2))));
|
|
112619
|
-
const rightV2 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", rightEnd.x, rightEnd.y, z2))));
|
|
112620
|
-
edges.push(createLineEdge(repo, rightV1, rightV2));
|
|
112621
|
-
const bottomArc = createArcEdge(repo, centerX, centerY + capOffset, z2, radius, 0, Math.PI, rotation, centerX, centerY);
|
|
112622
|
-
edges.push(bottomArc);
|
|
112623
|
-
const leftStart = rotatePoint(centerX - radius, centerY + capOffset, centerX, centerY, rotation);
|
|
112624
|
-
const leftEnd = rotatePoint(centerX - radius, centerY - capOffset, centerX, centerY, rotation);
|
|
112625
|
-
const leftV1 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", leftStart.x, leftStart.y, z2))));
|
|
112626
|
-
const leftV2 = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", leftEnd.x, leftEnd.y, z2))));
|
|
112627
|
-
edges.push(createLineEdge(repo, leftV1, leftV2));
|
|
112628
|
-
}
|
|
112629
|
-
const orientedEdges = edges.map((edge) => repo.add(new OrientedEdge("", edge, true)));
|
|
112630
|
-
return repo.add(new EdgeLoop("", orientedEdges));
|
|
112631
|
-
}
|
|
112632
|
-
function createPillCylindricalFaces(repo, hole, zMin, zMax, xDir, zDir) {
|
|
112614
|
+
radius
|
|
112615
|
+
};
|
|
112616
|
+
}
|
|
112617
|
+
function createPillBoundarySegments(repo, hole, z2) {
|
|
112633
112618
|
const geom = getPillGeometry(hole);
|
|
112634
112619
|
const {
|
|
112635
112620
|
centerX,
|
|
@@ -112639,103 +112624,75 @@ function createPillCylindricalFaces(repo, hole, zMin, zMax, xDir, zDir) {
|
|
|
112639
112624
|
rotation,
|
|
112640
112625
|
isHorizontal
|
|
112641
112626
|
} = geom;
|
|
112642
|
-
const
|
|
112627
|
+
const capOffset = straightHalfLength;
|
|
112628
|
+
const getVertex = createVertexCache(repo, z2);
|
|
112643
112629
|
if (isHorizontal) {
|
|
112644
|
-
|
|
112645
|
-
|
|
112646
|
-
|
|
112647
|
-
|
|
112648
|
-
|
|
112649
|
-
|
|
112650
|
-
|
|
112651
|
-
|
|
112652
|
-
|
|
112653
|
-
|
|
112654
|
-
|
|
112655
|
-
|
|
112656
|
-
|
|
112657
|
-
}
|
|
112658
|
-
function
|
|
112659
|
-
|
|
112660
|
-
|
|
112661
|
-
|
|
112662
|
-
const
|
|
112663
|
-
const
|
|
112664
|
-
const
|
|
112665
|
-
const
|
|
112666
|
-
const
|
|
112667
|
-
const
|
|
112668
|
-
const
|
|
112669
|
-
const
|
|
112670
|
-
|
|
112671
|
-
|
|
112672
|
-
|
|
112673
|
-
|
|
112674
|
-
|
|
112675
|
-
|
|
112676
|
-
|
|
112677
|
-
|
|
112678
|
-
|
|
112679
|
-
|
|
112680
|
-
|
|
112681
|
-
|
|
112682
|
-
|
|
112683
|
-
|
|
112684
|
-
|
|
112685
|
-
|
|
112686
|
-
|
|
112687
|
-
|
|
112688
|
-
|
|
112689
|
-
|
|
112690
|
-
|
|
112691
|
-
|
|
112692
|
-
|
|
112693
|
-
|
|
112694
|
-
|
|
112695
|
-
|
|
112696
|
-
|
|
112697
|
-
|
|
112698
|
-
|
|
112699
|
-
|
|
112700
|
-
|
|
112701
|
-
|
|
112702
|
-
|
|
112703
|
-
|
|
112704
|
-
|
|
112705
|
-
|
|
112706
|
-
|
|
112707
|
-
|
|
112708
|
-
|
|
112709
|
-
|
|
112710
|
-
const edgeLength = Math.sqrt(dx * dx + dy * dy);
|
|
112711
|
-
const bottomDir = repo.add(new Direction("", dx / edgeLength, dy / edgeLength, 0));
|
|
112712
|
-
const bottomVec = repo.add(new Vector("", bottomDir, edgeLength));
|
|
112713
|
-
const bottomLine = repo.add(new Line("", v1.resolve(repo).pnt, bottomVec));
|
|
112714
|
-
const bottomEdge = repo.add(new EdgeCurve("", v1, v2, bottomLine, true));
|
|
112715
|
-
const topDir = repo.add(new Direction("", dx / edgeLength, dy / edgeLength, 0));
|
|
112716
|
-
const topVec = repo.add(new Vector("", topDir, edgeLength));
|
|
112717
|
-
const topLine = repo.add(new Line("", v4.resolve(repo).pnt, topVec));
|
|
112718
|
-
const topEdge = repo.add(new EdgeCurve("", v4, v3, topLine, true));
|
|
112719
|
-
const vertDir = repo.add(new Direction("", 0, 0, 1));
|
|
112720
|
-
const height = zMax - zMin;
|
|
112721
|
-
const vertVec1 = repo.add(new Vector("", vertDir, height));
|
|
112722
|
-
const vertLine1 = repo.add(new Line("", v2.resolve(repo).pnt, vertVec1));
|
|
112723
|
-
const vertEdge1 = repo.add(new EdgeCurve("", v2, v3, vertLine1, true));
|
|
112724
|
-
const vertVec2 = repo.add(new Vector("", vertDir, height));
|
|
112725
|
-
const vertLine2 = repo.add(new Line("", v1.resolve(repo).pnt, vertVec2));
|
|
112726
|
-
const vertEdge2 = repo.add(new EdgeCurve("", v1, v4, vertLine2, true));
|
|
112727
|
-
const loop = repo.add(new EdgeLoop("", [
|
|
112728
|
-
repo.add(new OrientedEdge("", bottomEdge, true)),
|
|
112729
|
-
repo.add(new OrientedEdge("", vertEdge1, true)),
|
|
112730
|
-
repo.add(new OrientedEdge("", topEdge, false)),
|
|
112731
|
-
repo.add(new OrientedEdge("", vertEdge2, false))
|
|
112732
|
-
]));
|
|
112733
|
-
const normalDir = repo.add(new Direction("", dy / edgeLength, -dx / edgeLength, 0));
|
|
112734
|
-
const refDir = repo.add(new Direction("", dx / edgeLength, dy / edgeLength, 0));
|
|
112735
|
-
const planeOrigin = repo.add(new CartesianPoint("", start.x, start.y, zMin));
|
|
112736
|
-
const placement = repo.add(new Axis2Placement3D("", planeOrigin, normalDir, refDir));
|
|
112737
|
-
const plane = repo.add(new Plane("", placement));
|
|
112738
|
-
return repo.add(new AdvancedFace("", [repo.add(new FaceOuterBound("", loop, true))], plane, true));
|
|
112630
|
+
return [
|
|
112631
|
+
createArcSegment(repo, centerX + capOffset, centerY, z2, radius, -Math.PI / 2, Math.PI / 2, rotation, centerX, centerY, getVertex),
|
|
112632
|
+
createLineSegment(repo, rotatePoint(centerX + capOffset, centerY - radius, centerX, centerY, rotation), rotatePoint(centerX - capOffset, centerY - radius, centerX, centerY, rotation), getVertex),
|
|
112633
|
+
createArcSegment(repo, centerX - capOffset, centerY, z2, radius, Math.PI / 2, 3 * Math.PI / 2, rotation, centerX, centerY, getVertex),
|
|
112634
|
+
createLineSegment(repo, rotatePoint(centerX - capOffset, centerY + radius, centerX, centerY, rotation), rotatePoint(centerX + capOffset, centerY + radius, centerX, centerY, rotation), getVertex)
|
|
112635
|
+
];
|
|
112636
|
+
}
|
|
112637
|
+
return [
|
|
112638
|
+
createArcSegment(repo, centerX, centerY - capOffset, z2, radius, Math.PI, 0, rotation, centerX, centerY, getVertex),
|
|
112639
|
+
createLineSegment(repo, rotatePoint(centerX + radius, centerY - capOffset, centerX, centerY, rotation), rotatePoint(centerX + radius, centerY + capOffset, centerX, centerY, rotation), getVertex),
|
|
112640
|
+
createArcSegment(repo, centerX, centerY + capOffset, z2, radius, 0, Math.PI, rotation, centerX, centerY, getVertex),
|
|
112641
|
+
createLineSegment(repo, rotatePoint(centerX - radius, centerY + capOffset, centerX, centerY, rotation), rotatePoint(centerX - radius, centerY - capOffset, centerX, centerY, rotation), getVertex)
|
|
112642
|
+
];
|
|
112643
|
+
}
|
|
112644
|
+
function createLoopFromSegments(repo, segments, orientation) {
|
|
112645
|
+
return repo.add(new EdgeLoop("", segments.map((segment) => repo.add(new OrientedEdge("", segment.edge, orientation)))));
|
|
112646
|
+
}
|
|
112647
|
+
function createPillHoleGeometry(repo, hole, zMin, zMax, zDir) {
|
|
112648
|
+
const geom = getPillGeometry(hole);
|
|
112649
|
+
const bottomSegments = createPillBoundarySegments(repo, hole, zMin);
|
|
112650
|
+
const topSegments = createPillBoundarySegments(repo, hole, zMax);
|
|
112651
|
+
const bottomLoop = createLoopFromSegments(repo, bottomSegments, true);
|
|
112652
|
+
const topLoop = createLoopFromSegments(repo, topSegments, true);
|
|
112653
|
+
const wallFaces = [];
|
|
112654
|
+
const verticalEdges = /* @__PURE__ */ new Map;
|
|
112655
|
+
const getVerticalEdge = (bottomVertex, topVertex) => {
|
|
112656
|
+
const key = `${bottomVertex.id}:${topVertex.id}`;
|
|
112657
|
+
const existing = verticalEdges.get(key);
|
|
112658
|
+
if (existing)
|
|
112659
|
+
return existing;
|
|
112660
|
+
const edge = createLineEdge(repo, bottomVertex, topVertex);
|
|
112661
|
+
verticalEdges.set(key, edge);
|
|
112662
|
+
return edge;
|
|
112663
|
+
};
|
|
112664
|
+
for (let i = 0;i < bottomSegments.length; i++) {
|
|
112665
|
+
const bottomSegment = bottomSegments[i];
|
|
112666
|
+
const topSegment = topSegments[i];
|
|
112667
|
+
const startVertical = getVerticalEdge(bottomSegment.start, topSegment.start);
|
|
112668
|
+
const endVertical = getVerticalEdge(bottomSegment.end, topSegment.end);
|
|
112669
|
+
const loop = repo.add(new EdgeLoop("", [
|
|
112670
|
+
repo.add(new OrientedEdge("", bottomSegment.edge, true)),
|
|
112671
|
+
repo.add(new OrientedEdge("", endVertical, true)),
|
|
112672
|
+
repo.add(new OrientedEdge("", topSegment.edge, false)),
|
|
112673
|
+
repo.add(new OrientedEdge("", startVertical, false))
|
|
112674
|
+
]));
|
|
112675
|
+
if (bottomSegment.kind === "arc") {
|
|
112676
|
+
const center = rotatePoint(bottomSegment.centerX, bottomSegment.centerY, geom.centerX, geom.centerY, geom.rotation);
|
|
112677
|
+
const bottomCenter = repo.add(new CartesianPoint("", center.x, center.y, zMin));
|
|
112678
|
+
const refDir2 = repo.add(new Direction("", Math.cos(geom.rotation), Math.sin(geom.rotation), 0));
|
|
112679
|
+
const cylinderPlacement = repo.add(new Axis2Placement3D("", bottomCenter, zDir, refDir2));
|
|
112680
|
+
const cylinderSurface = repo.add(new CylindricalSurface("", cylinderPlacement, bottomSegment.radius));
|
|
112681
|
+
wallFaces.push(repo.add(new AdvancedFace("", [repo.add(new FaceOuterBound("", loop, true))], cylinderSurface, false)));
|
|
112682
|
+
continue;
|
|
112683
|
+
}
|
|
112684
|
+
const startPoint = bottomSegment.start.resolve(repo).pnt.resolve(repo);
|
|
112685
|
+
const endPoint = bottomSegment.end.resolve(repo).pnt.resolve(repo);
|
|
112686
|
+
const dx = endPoint.x - startPoint.x;
|
|
112687
|
+
const dy = endPoint.y - startPoint.y;
|
|
112688
|
+
const edgeLength = Math.sqrt(dx * dx + dy * dy);
|
|
112689
|
+
const normalDir = repo.add(new Direction("", dy / edgeLength, -dx / edgeLength, 0));
|
|
112690
|
+
const refDir = repo.add(new Direction("", dx / edgeLength, dy / edgeLength, 0));
|
|
112691
|
+
const placement = repo.add(new Axis2Placement3D("", bottomSegment.start.resolve(repo).pnt, normalDir, refDir));
|
|
112692
|
+
const plane = repo.add(new Plane("", placement));
|
|
112693
|
+
wallFaces.push(repo.add(new AdvancedFace("", [repo.add(new FaceOuterBound("", loop, true))], plane, true)));
|
|
112694
|
+
}
|
|
112695
|
+
return { bottomLoop, topLoop, wallFaces };
|
|
112739
112696
|
}
|
|
112740
112697
|
async function circuitJsonToStep(circuitJson, options = {}) {
|
|
112741
112698
|
const repo = new Repository;
|
|
@@ -112871,50 +112828,61 @@ async function circuitJsonToStep(circuitJson, options = {}) {
|
|
|
112871
112828
|
const bottomFrame = repo.add(new Axis2Placement3D("", origin, repo.add(new Direction("", 0, 0, -1)), xDir));
|
|
112872
112829
|
const bottomPlane = repo.add(new Plane("", bottomFrame));
|
|
112873
112830
|
const bottomLoop = repo.add(new EdgeLoop("", bottomEdges.map((edge) => repo.add(new OrientedEdge("", edge, true)))));
|
|
112874
|
-
const bottomHoleLoops = [];
|
|
112875
|
-
for (const hole of holes) {
|
|
112876
|
-
const holeShape = hole.hole_shape ?? hole.shape;
|
|
112877
|
-
if (holeShape === "circle") {
|
|
112878
|
-
const holeX = typeof hole.x === "number" ? hole.x : hole.x ?? 0;
|
|
112879
|
-
const holeY = typeof hole.y === "number" ? hole.y : hole.y ?? 0;
|
|
112880
|
-
const radius = (hole.hole_diameter ?? 0) / 2;
|
|
112881
|
-
const holeCenter = repo.add(new CartesianPoint("", holeX, holeY, -halfBoardThickness));
|
|
112882
|
-
const holeVertex = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", holeX + radius, holeY, -halfBoardThickness))));
|
|
112883
|
-
const holePlacement = repo.add(new Axis2Placement3D("", holeCenter, repo.add(new Direction("", 0, 0, -1)), xDir));
|
|
112884
|
-
const holeCircle = repo.add(new Circle("", holePlacement, radius));
|
|
112885
|
-
const holeEdge = repo.add(new EdgeCurve("", holeVertex, holeVertex, holeCircle, true));
|
|
112886
|
-
const holeLoop = repo.add(new EdgeLoop("", [repo.add(new OrientedEdge("", holeEdge, false))]));
|
|
112887
|
-
bottomHoleLoops.push(repo.add(new FaceBound("", holeLoop, true)));
|
|
112888
|
-
} else if (holeShape === "rotated_pill" || holeShape === "pill") {
|
|
112889
|
-
const pillLoop = createPillHoleLoop(repo, hole, -halfBoardThickness, xDir);
|
|
112890
|
-
bottomHoleLoops.push(repo.add(new FaceBound("", pillLoop, true)));
|
|
112891
|
-
}
|
|
112892
|
-
}
|
|
112893
|
-
const bottomFace = repo.add(new AdvancedFace("", [repo.add(new FaceOuterBound("", bottomLoop, true)), ...bottomHoleLoops], bottomPlane, true));
|
|
112894
112831
|
const topOrigin = repo.add(new CartesianPoint("", 0, 0, halfBoardThickness));
|
|
112895
112832
|
const topFrame = repo.add(new Axis2Placement3D("", topOrigin, zDir, xDir));
|
|
112896
112833
|
const topPlane = repo.add(new Plane("", topFrame));
|
|
112897
112834
|
const topLoop = repo.add(new EdgeLoop("", topEdges.map((edge) => repo.add(new OrientedEdge("", edge, false)))));
|
|
112898
|
-
|
|
112835
|
+
function getHoleCoordinate(coordinate) {
|
|
112836
|
+
if (typeof coordinate === "number")
|
|
112837
|
+
return coordinate;
|
|
112838
|
+
return coordinate?.value ?? 0;
|
|
112839
|
+
}
|
|
112840
|
+
function createCircularHoleGeometry(hole) {
|
|
112841
|
+
const holeX = getHoleCoordinate(hole.x);
|
|
112842
|
+
const holeY = getHoleCoordinate(hole.y);
|
|
112843
|
+
const radius = (hole.hole_diameter ?? 0) / 2;
|
|
112844
|
+
const bottomHoleCenter = repo.add(new CartesianPoint("", holeX, holeY, -halfBoardThickness));
|
|
112845
|
+
const bottomHoleVertex = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", holeX + radius, holeY, -halfBoardThickness))));
|
|
112846
|
+
const bottomHolePlacement = repo.add(new Axis2Placement3D("", bottomHoleCenter, repo.add(new Direction("", 0, 0, -1)), xDir));
|
|
112847
|
+
const bottomHoleCircle = repo.add(new Circle("", bottomHolePlacement, radius));
|
|
112848
|
+
const bottomHoleEdge = repo.add(new EdgeCurve("", bottomHoleVertex, bottomHoleVertex, bottomHoleCircle, true));
|
|
112849
|
+
const topHoleCenter = repo.add(new CartesianPoint("", holeX, holeY, halfBoardThickness));
|
|
112850
|
+
const topHoleVertex = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", holeX + radius, holeY, halfBoardThickness))));
|
|
112851
|
+
const topHolePlacement = repo.add(new Axis2Placement3D("", topHoleCenter, zDir, xDir));
|
|
112852
|
+
const topHoleCircle = repo.add(new Circle("", topHolePlacement, radius));
|
|
112853
|
+
const topHoleEdge = repo.add(new EdgeCurve("", topHoleVertex, topHoleVertex, topHoleCircle, true));
|
|
112854
|
+
const bottomLoop2 = repo.add(new EdgeLoop("", [repo.add(new OrientedEdge("", bottomHoleEdge, false))]));
|
|
112855
|
+
const topLoop2 = repo.add(new EdgeLoop("", [repo.add(new OrientedEdge("", topHoleEdge, true))]));
|
|
112856
|
+
const wallLoop = repo.add(new EdgeLoop("", [
|
|
112857
|
+
repo.add(new OrientedEdge("", bottomHoleEdge, true)),
|
|
112858
|
+
repo.add(new OrientedEdge("", topHoleEdge, false))
|
|
112859
|
+
]));
|
|
112860
|
+
const holeCylinderPlacement = repo.add(new Axis2Placement3D("", bottomHoleCenter, zDir, xDir));
|
|
112861
|
+
const holeCylinderSurface = repo.add(new CylindricalSurface("", holeCylinderPlacement, radius));
|
|
112862
|
+
const wallFace = repo.add(new AdvancedFace("", [repo.add(new FaceOuterBound("", wallLoop, true))], holeCylinderSurface, false));
|
|
112863
|
+
return { bottomLoop: bottomLoop2, topLoop: topLoop2, wallFaces: [wallFace] };
|
|
112864
|
+
}
|
|
112865
|
+
const sharedHoleGeometries = [];
|
|
112899
112866
|
for (const hole of holes) {
|
|
112900
112867
|
const holeShape = hole.hole_shape ?? hole.shape;
|
|
112901
112868
|
if (holeShape === "circle") {
|
|
112902
|
-
|
|
112903
|
-
const holeY = typeof hole.y === "number" ? hole.y : hole.y ?? 0;
|
|
112904
|
-
const radius = (hole.hole_diameter ?? 0) / 2;
|
|
112905
|
-
const holeCenter = repo.add(new CartesianPoint("", holeX, holeY, halfBoardThickness));
|
|
112906
|
-
const holeVertex = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", holeX + radius, holeY, halfBoardThickness))));
|
|
112907
|
-
const holePlacement = repo.add(new Axis2Placement3D("", holeCenter, zDir, xDir));
|
|
112908
|
-
const holeCircle = repo.add(new Circle("", holePlacement, radius));
|
|
112909
|
-
const holeEdge = repo.add(new EdgeCurve("", holeVertex, holeVertex, holeCircle, true));
|
|
112910
|
-
const holeLoop = repo.add(new EdgeLoop("", [repo.add(new OrientedEdge("", holeEdge, true))]));
|
|
112911
|
-
topHoleLoops.push(repo.add(new FaceBound("", holeLoop, true)));
|
|
112869
|
+
sharedHoleGeometries.push(createCircularHoleGeometry(hole));
|
|
112912
112870
|
} else if (holeShape === "rotated_pill" || holeShape === "pill") {
|
|
112913
|
-
|
|
112914
|
-
topHoleLoops.push(repo.add(new FaceBound("", pillLoop, true)));
|
|
112871
|
+
sharedHoleGeometries.push(createPillHoleGeometry(repo, hole, -halfBoardThickness, halfBoardThickness, zDir));
|
|
112915
112872
|
}
|
|
112916
112873
|
}
|
|
112874
|
+
const bottomHoleLoops = [];
|
|
112875
|
+
const topHoleLoops = [];
|
|
112876
|
+
for (const holeGeometry of sharedHoleGeometries) {
|
|
112877
|
+
bottomHoleLoops.push(repo.add(new FaceBound("", holeGeometry.bottomLoop, true)));
|
|
112878
|
+
topHoleLoops.push(repo.add(new FaceBound("", holeGeometry.topLoop, true)));
|
|
112879
|
+
}
|
|
112880
|
+
const bottomFace = repo.add(new AdvancedFace("", [repo.add(new FaceOuterBound("", bottomLoop, true)), ...bottomHoleLoops], bottomPlane, true));
|
|
112917
112881
|
const topFace = repo.add(new AdvancedFace("", [repo.add(new FaceOuterBound("", topLoop, true)), ...topHoleLoops], topPlane, true));
|
|
112882
|
+
const holeCylindricalFaces = [];
|
|
112883
|
+
for (const holeGeometry of sharedHoleGeometries) {
|
|
112884
|
+
holeCylindricalFaces.push(...holeGeometry.wallFaces);
|
|
112885
|
+
}
|
|
112918
112886
|
const sideFaces = [];
|
|
112919
112887
|
for (let i = 0;i < bottomEdges.length; i++) {
|
|
112920
112888
|
const nextI = (i + 1) % bottomEdges.length;
|
|
@@ -112940,36 +112908,6 @@ async function circuitJsonToStep(circuitJson, options = {}) {
|
|
|
112940
112908
|
const sideFace = repo.add(new AdvancedFace("", [repo.add(new FaceOuterBound("", sideLoop, true))], sidePlane, true));
|
|
112941
112909
|
sideFaces.push(sideFace);
|
|
112942
112910
|
}
|
|
112943
|
-
const holeCylindricalFaces = [];
|
|
112944
|
-
for (const hole of holes) {
|
|
112945
|
-
const holeShape = hole.hole_shape ?? hole.shape;
|
|
112946
|
-
if (holeShape === "circle") {
|
|
112947
|
-
const holeX = typeof hole.x === "number" ? hole.x : hole.x ?? 0;
|
|
112948
|
-
const holeY = typeof hole.y === "number" ? hole.y : hole.y ?? 0;
|
|
112949
|
-
const radius = (hole.hole_diameter ?? 0) / 2;
|
|
112950
|
-
const bottomHoleCenter = repo.add(new CartesianPoint("", holeX, holeY, -halfBoardThickness));
|
|
112951
|
-
const bottomHoleVertex = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", holeX + radius, holeY, -halfBoardThickness))));
|
|
112952
|
-
const bottomHolePlacement = repo.add(new Axis2Placement3D("", bottomHoleCenter, repo.add(new Direction("", 0, 0, -1)), xDir));
|
|
112953
|
-
const bottomHoleCircle = repo.add(new Circle("", bottomHolePlacement, radius));
|
|
112954
|
-
const bottomHoleEdge = repo.add(new EdgeCurve("", bottomHoleVertex, bottomHoleVertex, bottomHoleCircle, true));
|
|
112955
|
-
const topHoleCenter = repo.add(new CartesianPoint("", holeX, holeY, halfBoardThickness));
|
|
112956
|
-
const topHoleVertex = repo.add(new VertexPoint("", repo.add(new CartesianPoint("", holeX + radius, holeY, halfBoardThickness))));
|
|
112957
|
-
const topHolePlacement = repo.add(new Axis2Placement3D("", topHoleCenter, zDir, xDir));
|
|
112958
|
-
const topHoleCircle = repo.add(new Circle("", topHolePlacement, radius));
|
|
112959
|
-
const topHoleEdge = repo.add(new EdgeCurve("", topHoleVertex, topHoleVertex, topHoleCircle, true));
|
|
112960
|
-
const holeCylinderLoop = repo.add(new EdgeLoop("", [
|
|
112961
|
-
repo.add(new OrientedEdge("", bottomHoleEdge, true)),
|
|
112962
|
-
repo.add(new OrientedEdge("", topHoleEdge, false))
|
|
112963
|
-
]));
|
|
112964
|
-
const holeCylinderPlacement = repo.add(new Axis2Placement3D("", bottomHoleCenter, zDir, xDir));
|
|
112965
|
-
const holeCylinderSurface = repo.add(new CylindricalSurface("", holeCylinderPlacement, radius));
|
|
112966
|
-
const holeCylinderFace = repo.add(new AdvancedFace("", [repo.add(new FaceOuterBound("", holeCylinderLoop, true))], holeCylinderSurface, false));
|
|
112967
|
-
holeCylindricalFaces.push(holeCylinderFace);
|
|
112968
|
-
} else if (holeShape === "rotated_pill" || holeShape === "pill") {
|
|
112969
|
-
const pillFaces = createPillCylindricalFaces(repo, hole, -halfBoardThickness, halfBoardThickness, xDir, zDir);
|
|
112970
|
-
holeCylindricalFaces.push(...pillFaces);
|
|
112971
|
-
}
|
|
112972
|
-
}
|
|
112973
112911
|
const allFaces = [bottomFace, topFace, ...sideFaces, ...holeCylindricalFaces];
|
|
112974
112912
|
const styleCache = createStyleCache();
|
|
112975
112913
|
const boardStyledItems = createStyledItems(repo, {
|
package/dist/lib/index.js
CHANGED
|
@@ -65661,7 +65661,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
|
|
|
65661
65661
|
}));
|
|
65662
65662
|
};
|
|
65663
65663
|
// package.json
|
|
65664
|
-
var version = "0.1.
|
|
65664
|
+
var version = "0.1.1380";
|
|
65665
65665
|
var package_default = {
|
|
65666
65666
|
name: "@tscircuit/cli",
|
|
65667
65667
|
version,
|
|
@@ -65702,7 +65702,7 @@ var package_default = {
|
|
|
65702
65702
|
"circuit-json-to-pnp-csv": "^0.0.7",
|
|
65703
65703
|
"circuit-json-to-readable-netlist": "^0.0.15",
|
|
65704
65704
|
"circuit-json-to-spice": "^0.0.10",
|
|
65705
|
-
"circuit-json-to-step": "^0.0.
|
|
65705
|
+
"circuit-json-to-step": "^0.0.32",
|
|
65706
65706
|
"circuit-json-to-tscircuit": "^0.0.9",
|
|
65707
65707
|
"circuit-json-trace-length-analysis": "github:tscircuit/circuit-json-trace-length-analysis#2b44792a40df0ca83b6bfb6ac95ed5e35e7168b8",
|
|
65708
65708
|
commander: "^14.0.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1381",
|
|
4
4
|
"main": "dist/cli/main.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/cli/main.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"circuit-json-to-pnp-csv": "^0.0.7",
|
|
39
39
|
"circuit-json-to-readable-netlist": "^0.0.15",
|
|
40
40
|
"circuit-json-to-spice": "^0.0.10",
|
|
41
|
-
"circuit-json-to-step": "^0.0.
|
|
41
|
+
"circuit-json-to-step": "^0.0.32",
|
|
42
42
|
"circuit-json-to-tscircuit": "^0.0.9",
|
|
43
43
|
"circuit-json-trace-length-analysis": "github:tscircuit/circuit-json-trace-length-analysis#2b44792a40df0ca83b6bfb6ac95ed5e35e7168b8",
|
|
44
44
|
"commander": "^14.0.0",
|