build-dxf 0.1.110 → 0.1.111
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/package.json +1 -1
- package/src/build.js +20 -10
package/package.json
CHANGED
package/src/build.js
CHANGED
|
@@ -9833,17 +9833,27 @@ class ThreeVJiaPipeline extends Pipeline {
|
|
|
9833
9833
|
if (roomPloys.length === 0) return json;
|
|
9834
9834
|
publicInfo.itemInfo.forEach((item, i) => {
|
|
9835
9835
|
if (!placeHoldersMap[item.category]) return;
|
|
9836
|
-
const contour = item.quadContour ?? item.contour
|
|
9836
|
+
const contour = item.quadContour ?? item.contour;
|
|
9837
|
+
if (contour.length === 0) {
|
|
9838
|
+
console.warn(`第${i}个物品轮廓为空`);
|
|
9839
|
+
return;
|
|
9840
|
+
}
|
|
9841
|
+
const itemPoly = new Polygon(contour.map((p2) => Point.from(p2).rotate(json.center, json.angle))), center = itemPoly.getCenter(), index2 = roomPloys.findIndex((poly) => poly.pointWithin(center));
|
|
9837
9842
|
if (index2 < 0) return;
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
|
|
9841
|
-
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9843
|
+
try {
|
|
9844
|
+
const rect = itemPoly.getMinimumBoundingRectangle().map((p2) => p2.toJson2D());
|
|
9845
|
+
json.placeHolders.push({
|
|
9846
|
+
name: placeHoldersMap[item.category],
|
|
9847
|
+
polygon: rect,
|
|
9848
|
+
direction: Point.from(item.direction).rotate(Point.zero(), json.angle),
|
|
9849
|
+
height: item.box.max.z - item.box.min.z,
|
|
9850
|
+
sillHeight: item.box.min.z - z,
|
|
9851
|
+
roomId: rooms[index2].roomTypeId,
|
|
9852
|
+
id: i
|
|
9853
|
+
});
|
|
9854
|
+
} catch (error) {
|
|
9855
|
+
console.warn(`第${i}个物品解析异常`);
|
|
9856
|
+
}
|
|
9847
9857
|
});
|
|
9848
9858
|
return json;
|
|
9849
9859
|
}
|