1 Commits

Author SHA1 Message Date
62140080c9 更新文件 2025-10-27 14:45:59 +08:00

View File

@@ -1,31 +1,29 @@
import geom2 from '@jscad/modeling/src/geometries/geom2';
import geom3, { toPolygons, transform as transform$1 } from '@jscad/modeling/src/geometries/geom3';
import poly3, { create } from '@jscad/modeling/src/geometries/poly3';
import mat4 from '@jscad/modeling/src/maths/mat4';
import { measureAggregateVolume, measureBoundingBox as measureBoundingBox$1 } from '@jscad/modeling/src/measurements';
import { Vector3, FrontSide, LineDashedMaterial, Vector2 as Vector2$1, DoubleSide, MeshBasicMaterial, LineBasicMaterial, LineDashDotMaterial, LineDashDoubleDotMaterial, LineCenterMaterial, ShaderMaterial, Color, Matrix4, Box3, MeshPhysicalMaterial, ClampToEdgeWrapping, Object3D, MathUtils, Quaternion, BufferGeometry, Shape as Shape$1, ShapeGeometry, BufferAttribute, Line as Line$1, Plane as Plane$1, Line3, EllipseCurve, CatmullRomCurve3, Box2 as Box2$1, Float32BufferAttribute, Path as Path$1, Geometry, Face3, LineSegments, Mesh, CylinderBufferGeometry, InstancedInterleavedBuffer, InterleavedBufferAttribute, ShapeUtils, BoxBufferGeometry, BackSide, ExtrudeGeometry, Group, BoxGeometry, Triangle, Euler, ShapeBufferGeometry, OrthographicCamera, PerspectiveCamera, AmbientLight as AmbientLight$1, DirectionalLightHelper, SphereBufferGeometry, Matrix3, DirectionalLight as DirectionalLight$1, HemisphereLight as HemisphereLight$1, MirroredRepeatWrapping, Texture, ImageLoader, Scene, WebGLRenderTarget, Frustum, MeshNormalMaterial, TextureLoader, PointLight as PointLight$1, SphereGeometry, RectAreaLight as RectAreaLight$1, SpotLight as SpotLight$1, ConeGeometry, PointsMaterial, Points, Raycaster } from 'three';
import { Line2 } from 'three/examples/jsm/lines/Line2';
import { LineGeometry } from 'three/examples/jsm/lines/LineGeometry';
import { LineSegments2 } from 'three/examples/jsm/lines/LineSegments2';
import { LineSegmentsGeometry } from 'three/examples/jsm/lines/LineSegmentsGeometry';
import geom3, { toPolygons, transform as transform$1 } from '@jscad/modeling/src/geometries/geom3';
import mat4 from '@jscad/modeling/src/maths/mat4';
import measureBoundingBox from '@jscad/modeling/src/measurements/measureBoundingBox';
import { intersect, scission } from '@jscad/modeling/src/operations/booleans';
import splitPolygonByPlane from '@jscad/modeling/src/operations/booleans/trees/splitPolygonByPlane';
import retessellate from '@jscad/modeling/src/operations/modifiers/retessellate';
import { transform } from '@jscad/modeling/src/operations/transforms';
import { LineMaterial } from 'three/examples/jsm/lines/LineMaterial';
import { iaop, end } from 'xaop';
import poly3, { create } from '@jscad/modeling/src/geometries/poly3';
import Flatbush from 'flatbush';
import { intersect, scission } from '@jscad/modeling/src/operations/booleans';
import geom2 from '@jscad/modeling/src/geometries/geom2';
import extrudeLinear from '@jscad/modeling/src/operations/extrusions/extrudeLinear';
import extrudeRotate from '@jscad/modeling/src/operations/extrusions/extrudeRotate';
import { retessellate as retessellate$1 } from '@jscad/modeling/src/operations/modifiers';
import retessellate from '@jscad/modeling/src/operations/modifiers/retessellate';
import { transform } from '@jscad/modeling/src/operations/transforms';
import Flatbush from 'flatbush';
import * as clipperLib from 'js-angusj-clipper/web';
import { EndType, JoinType } from 'js-angusj-clipper/web';
import pako from 'pako';
import { JoinType, EndType } from 'js-angusj-clipper/web';
import polylabel from 'polylabel';
import { AmbientLight as AmbientLight$1, BackSide, Box2 as Box2$1, Box3, BoxBufferGeometry, BoxGeometry, BufferAttribute, BufferGeometry, CatmullRomCurve3, ClampToEdgeWrapping, Color, ConeGeometry, CylinderBufferGeometry, DirectionalLight as DirectionalLight$1, DirectionalLightHelper, DoubleSide, EllipseCurve, Euler, ExtrudeGeometry, Face3, Float32BufferAttribute, FrontSide, Frustum, Geometry, Group, HemisphereLight as HemisphereLight$1, ImageLoader, InstancedInterleavedBuffer, InterleavedBufferAttribute, Line as Line$1, Line3, LineBasicMaterial, LineCenterMaterial, LineDashDotMaterial, LineDashDoubleDotMaterial, LineDashedMaterial, LineSegments, MathUtils, Matrix3, Matrix4, Mesh, MeshBasicMaterial, MeshNormalMaterial, MeshPhysicalMaterial, MirroredRepeatWrapping, Object3D, OrthographicCamera, Path as Path$1, PerspectiveCamera, Plane as Plane$1, PointLight as PointLight$1, Points, PointsMaterial, Quaternion, Raycaster, RectAreaLight as RectAreaLight$1, Scene, ShaderMaterial, Shape as Shape$1, ShapeBufferGeometry, ShapeGeometry, ShapeUtils, SphereBufferGeometry, SphereGeometry, SpotLight as SpotLight$1, Texture, TextureLoader, Triangle, Vector2 as Vector2$1, Vector3, WebGLRenderTarget } from 'three';
import { Line2 } from 'three/examples/jsm/lines/Line2';
import { LineGeometry } from 'three/examples/jsm/lines/LineGeometry';
import { LineMaterial } from 'three/examples/jsm/lines/LineMaterial';
import { LineSegments2 } from 'three/examples/jsm/lines/LineSegments2';
import { LineSegmentsGeometry } from 'three/examples/jsm/lines/LineSegmentsGeometry';
import { end, iaop } from 'xaop';
function observable() { };
function toJS() { };
/******************************************************************************
Copyright (c) Microsoft Corporation.
@@ -57846,124 +57844,6 @@ TemplateCirArray = __decorate([
Factory
], TemplateCirArray);
function GetCurHost() {
let searchParams = new URLSearchParams(globalThis.location?.search);
if (searchParams.has("server"))
return searchParams.get("server");
else {
let hostname = globalThis.location?.hostname;
switch (hostname) {
case "cfcad.cn":
case "www.cfcad.cn":
return "https://api.cfcad.cn";
case "vip.cfcad.cn":
return "https://vapi.cfcad.cn";
case "v.cfcad.cn":
return "https://vapi.cfcad.cn";
case "t.cfcad.cn":
return "https://tapi.cfcad.cn:7779";
case "tvip.cfcad.cn":
return "https://tvapi.cfcad.cn:7779";
case "tv.cfcad.cn":
return "https://tvapi.cfcad.cn:7779";
default:
return "https://tapi.cfcad.cn:7779";
}
}
}
const CURRENT_HOST = GetCurHost();
const TemplateUrls = {
create: CURRENT_HOST + "/CAD-moduleCreate",
delete: CURRENT_HOST + "/CAD-moduleDelete",
detail: CURRENT_HOST + "/CAD-moduleDetail",
list: CURRENT_HOST + "/CAD-moduleList",
update: CURRENT_HOST + "/CAD-moduleUpdate",
search: CURRENT_HOST + "/GoodsSearch-WebCad",
move: CURRENT_HOST + "/CAD-moduleMove",
check: CURRENT_HOST + "/GoodsSearch-moduleManage",
uploadCover: CURRENT_HOST + "/CAD-moduleDiyLogo",
collection: CURRENT_HOST + "/CAD-colModuleList",
publishing: CURRENT_HOST + "/CAD-moduleDeploy",
};
//解压base64
function inflateBase64(base64) {
let binaryString = atob(base64);
let data = pako.inflate(binaryString, { to: "string" });
return data;
}
/**
* 删除模块节点,同时会删除其子节点
*/
function DeleteArrayTempate(template) {
template.Traverse(t => {
for (let id of t.Objects) {
if (!id.IsErase) {
let e = id.Object;
e.Erase();
}
}
t.Erase();
});
if (template.Parent?.Object) {
let parent = template.Parent.Object;
arrayRemoveOnce(parent.Children, template.Id);
}
}
async function GetArrayTemplate(tid, props) {
let data = await PostJson(TemplateUrls.detail, { module_id: tid });
if (data.err_code === 0) {
let file = JSON.parse(inflateBase64(data.modules.file));
let f = new CADFiler(file);
let db = new Database(false, false, true).FileRead(f);
let template = db.TemplateTable.Objects[0].Root;
if (props)
for (let par of props) {
let p = template.GetParam(par.name);
if (p)
p.expr = par.expr;
}
return template;
}
}
var RequestStatus;
(function (RequestStatus) {
RequestStatus[RequestStatus["Ok"] = 0] = "Ok";
RequestStatus[RequestStatus["None"] = -1] = "None";
RequestStatus[RequestStatus["OffLine"] = 44444] = "OffLine";
RequestStatus[RequestStatus["NoLogin"] = 88888] = "NoLogin";
RequestStatus[RequestStatus["CreateTempNoLogo"] = 802] = "CreateTempNoLogo";
})(RequestStatus || (RequestStatus = {}));
async function PostJson(url, body) {
let res = await Post(url, JSON.stringify(body));
return res;
}
async function Post(url, body) {
try {
let res = await fetch(url, {
method: "POST",
mode: "cors",
credentials: "include",
body,
});
let result = await res.json();
if (result.err_code === undefined)
return result;
switch (result.err_code) {
case RequestStatus.Ok:
break;
default:
Log("获取模块错误", LogType.Error);
}
return result;
}
catch (error) {
// ReportError(`请求url错误:${url}`);
return { err_code: RequestStatus.None, err_msg: `请求失败,地址:${url}` };
}
}
let TemplateCurveArray = class TemplateCurveArray extends TemplateArray {
constructor() {
super();
@@ -58216,70 +58096,6 @@ let TemplateCurveArray = class TemplateCurveArray extends TemplateArray {
}
async Update() {
await super.Update();
//临时DB 克隆的阵列对象
if (!this.Db.IsDefaultDatabase)
return;
const Path = this._DependCurveId?.Object;
if (!Path || !Path.Length)
return;
// 尝试获取第1-1-1个模块
if (!this._OriginArrayTempObjectId?.Object)
this._OriginArrayTempObjectId = this.Children[0];
if (!(this._OriginArrayTempObjectId && !this._OriginArrayTempObjectId.IsErase && this._OriginArrayTempObjectId.Object?.AllEntitys?.length)) {
if (this.IsUseTempArray) {
let temp = await GetArrayTemplate(this._OriginArrayTemplateId, this._OriginArrayTemplateParam);
if (temp) {
for (let children of [...this.Children])
DeleteArrayTempate(children.Object);
let originTemp = this.Db.WblockCloneObejcts([temp], this.Db.TemplateTable, new Map(), DuplicateRecordCloning.Ignore)[0];
this._OriginArrayTempObjectId = originTemp.Id;
this.SetRoomNameCabinetName(originTemp);
}
else {
Log("模块获取失败(可能不是您店铺的模块或模块已被删除)!!");
return;
}
}
else {
Log("实体获取失败(可能已被删除)!!");
return;
}
}
const OriginArrayTemp = this._OriginArrayTempObjectId.Object;
if (!OriginArrayTemp.AllEntitys.length) {
Log("阵列模块无实体");
return;
}
await this.ParseCaCheParams();
this.UpdateTempArray();
}
UpdateTempArray() {
const Count = this.CacheCount;
//将多余X列删除
if (Count < this.Children.length) {
for (let children of this.Children.splice(Count, this.Children.length - Count)) {
let temp = children.Object;
if (temp)
DeleteArrayTempate(temp);
}
}
if (!Count)
return;
const OriginArrayTemp = this._OriginArrayTempObjectId.Object;
//阵列模块用于克隆 现将父层置空防止克隆出错
OriginArrayTemp.Parent = undefined;
this.SetTempParams(OriginArrayTemp, 0);
for (let i = 0; i < Count - 1; i++) {
let temp;
if (i < this.Children.length) {
//修改子层存在的模块参数
temp = this.Children[i].Object;
this.SetTempParams(temp, i + 1);
}
else
this.BuildArrayTemplate(i + 1);
}
this.Children.unshift(OriginArrayTemp.objectId);
}
//#region -------------------------File-------------------------
//对象将自身数据写入到文件.
@@ -58889,5 +58705,5 @@ ViewportEntity2 = __decorate([
Factory
], ViewportEntity2);
export { AlignedDimension, AlignLineGroupRecord, AlignLineGroupTable, AllObjectData, AmbientLight, applyMixins, Arc, ArcBoardBuild, ArcDimension, AxisCS, BlockTable, BlockTableRecord, Board, boardUVGenerator, boardUVGenerator2, BoxSolid, BUL_IS_LINE_FUZZ, BulkheadCeiling, BulkheadCeiling_ContourType, CADFactory, CADFiler, CADObject, CameraSnapshootRecord, CameraType, CameraUpdate, Circle, clipperCpp, ColorInTransparent, CommandHistoryRecord, CompositeEntity, ContourTreeNode, CreateObjectData, CSG2Geometry, CSG2Geometry2, Curve, Curve3d, CURVE_DIR_TYPE_KEY, CURVE_FACE_TYPE_KEY, CURVE_MESH_NAMES, CURVE_WALL_TYPE_KEY, CurveTapeShape, CylinderHole, Cylineder, Database, DbCurve, DbText, DepthType, DiameterDimension, Dimension, DimStyleRecord, DimStyleTable, DimTextPosDir, DirectionalLight, DisposeTextShapeCache, DoorSpaceTemplateRecord, DuplicateRecordCloning, Ellipse, Entity, Entity3DS, EntityColorHistoryRecord, EntityFbx, EntityOBJ, EntityPLY, EntityRef, EntityRefModel, EntitySTL, EntityX3D, enumToArray, EraseEntityData, ExtendType$1 as ExtendType, ExtrudeBuildConfig, ExtrudeGeometryBuilder, ExtrudeHole, ExtrudeSolid, FaceEntity, Factory, FastDrillingEdgeGeometry, FastDrillingMeshGeometry, FastMeshGeometry, FontStyleRecord, FontStyleTable, GangDrillType, GenLocalUv, Geometry2CSG, Geometry2CSG2, GetBoxGeoBufferGeometry, GetHoleLengthOfIndex, Groove, GroupRecord, GroupTable, GroupType, HardwareCompositeEntity, HardwareTopline, HemisphereLight, HingeSpaceTemplateRecord, HistoricManage, HistorycRecord, Hole, Image, InitClipperCpp, IsBigHole, IsPhysical, LayerNode, LayerTable, LayerTableRecord, LeadRadiusDimension, Light, Line, LineAngularDimension, LinearDimension, LineHeightScaleMap, MaterialTableRecord, MaxDrawGrooveCount, MLeaderDimension, NameData, ObjectAllDataHistoryRecord, ObjectCollection, ObjectId, ObjectIdData, ObjectTreeData, OneCabinetRecord, PhysicalMaterialRecord, Point, PointLight, Polyline, Positioning, Positioning2Point, Positioning3Point, PositioningBoardSpace, PositioningClampSpace, PositioningFixed, PositioningHandleSpace, PositioningTemporary, ProcessingGroupRecord, ProcessingGroupTable, Purge, PurgeTemplateTreeRoot, RadiusDimension, RectAreaLight, Region, RelevancyType, RemoveObjectData, RenderState, RenderType, RevolveSolid, ROOM_REGION_CURVES_KEY, RoomBase, RoomFlatBase, RoomFlatFloor, RoomFlatTop, RoomHoleBase, RoomHoleLine, RoomHolePolyline, RoomRegion, RoomRegionParse, RoomWallArc, RoomWallBase, RoomWallLine, RoomWallParse, SealSolid, Shape2, Spline, SpotLight, Status, SubtractRange, SubtractRange2, SweepSolid, SymbolTable, SymbolTableRecord, Tape, TempalteActionRadiusType, TempateDefaultParamCount, TempateThicknessAction, TemplateAction, TemplateaRadiusAction, TemplateArcWindowRecord, TemplateArray, TemplateBehindBoard, TemplateBoardRecord, TemplateCirArray, TemplateCurveArray, TemplateEntityRef, TemplateFilletAction, TemplateKuGanRecord, TemplateLatticeRecord, TemplateLayerBoard, TemplateLeftRightBoardRecord, TemplateMaterialAction, TemplateMoveAction, TemplateParam, TemplateRecord, TemplateRectArray, TemplateRoomDoorRecord, TemplateSetSealAction, TemplateSizeBoard, TemplateStretchGripAction, TemplateStretchScaleBoxAction, TemplateTable, TemplateTopBottomBoard, TemplateVerticalBoard, TemplateVisualSpace, TemplateWindowRecord, TemplateWineRackRecord, TempPolyline$1 as TempPolyline, Text, TEXT_HEIGHT_SCALE, TextAligen, TextureTable, TextureTableEventBus, TextureTableRecord, ThicknessDirection, UpdateDraw, UpdateHoleFakerWallsAndUpdateDraw, UpdateRelevanceWallHole, UpdateTempPolyline, UpdateWallHolesDataAndUpdateDraw, UVFullType, UVType, ViewNearMinSize, ViewportEntity, ViewportEntity2, VisualSpaceBox, WallCurveDirType, WallFaceType };
export { AlignLineGroupRecord, AlignLineGroupTable, AlignedDimension, AllObjectData, AmbientLight, Arc, ArcBoardBuild, ArcDimension, AxisCS, BUL_IS_LINE_FUZZ, BlockTable, BlockTableRecord, Board, BoxSolid, BulkheadCeiling, BulkheadCeiling_ContourType, CADFactory, CADFiler, CADObject, CSG2Geometry, CSG2Geometry2, CURVE_DIR_TYPE_KEY, CURVE_FACE_TYPE_KEY, CURVE_MESH_NAMES, CURVE_WALL_TYPE_KEY, CameraSnapshootRecord, CameraType, CameraUpdate, Circle, ColorInTransparent, CommandHistoryRecord, CompositeEntity, ContourTreeNode, CreateObjectData, Curve, Curve3d, CurveTapeShape, CylinderHole, Cylineder, Database, DbCurve, DbText, DepthType, DiameterDimension, DimStyleRecord, DimStyleTable, DimTextPosDir, Dimension, DirectionalLight, DisposeTextShapeCache, DoorSpaceTemplateRecord, DuplicateRecordCloning, Ellipse, Entity, Entity3DS, EntityColorHistoryRecord, EntityFbx, EntityOBJ, EntityPLY, EntityRef, EntityRefModel, EntitySTL, EntityX3D, EraseEntityData, ExtendType$1 as ExtendType, ExtrudeBuildConfig, ExtrudeGeometryBuilder, ExtrudeHole, ExtrudeSolid, FaceEntity, Factory, FastDrillingEdgeGeometry, FastDrillingMeshGeometry, FastMeshGeometry, FontStyleRecord, FontStyleTable, GangDrillType, GenLocalUv, Geometry2CSG, Geometry2CSG2, GetBoxGeoBufferGeometry, GetHoleLengthOfIndex, Groove, GroupRecord, GroupTable, GroupType, HardwareCompositeEntity, HardwareTopline, HemisphereLight, HingeSpaceTemplateRecord, HistoricManage, HistorycRecord, Hole, Image, InitClipperCpp, IsBigHole, IsPhysical, LayerNode, LayerTable, LayerTableRecord, LeadRadiusDimension, Light, Line, LineAngularDimension, LineHeightScaleMap, LinearDimension, MLeaderDimension, MaterialTableRecord, MaxDrawGrooveCount, NameData, ObjectAllDataHistoryRecord, ObjectCollection, ObjectId, ObjectIdData, ObjectTreeData, OneCabinetRecord, PhysicalMaterialRecord, Point, PointLight, Polyline, Positioning, Positioning2Point, Positioning3Point, PositioningBoardSpace, PositioningClampSpace, PositioningFixed, PositioningHandleSpace, PositioningTemporary, ProcessingGroupRecord, ProcessingGroupTable, Purge, PurgeTemplateTreeRoot, ROOM_REGION_CURVES_KEY, RadiusDimension, RectAreaLight, Region, RelevancyType, RemoveObjectData, RenderState, RenderType, RevolveSolid, RoomBase, RoomFlatBase, RoomFlatFloor, RoomFlatTop, RoomHoleBase, RoomHoleLine, RoomHolePolyline, RoomRegion, RoomRegionParse, RoomWallArc, RoomWallBase, RoomWallLine, RoomWallParse, SealSolid, Shape2, Spline, SpotLight, Status, SubtractRange, SubtractRange2, SweepSolid, SymbolTable, SymbolTableRecord, TEXT_HEIGHT_SCALE, Tape, TempPolyline$1 as TempPolyline, TempalteActionRadiusType, TempateDefaultParamCount, TempateThicknessAction, TemplateAction, TemplateArcWindowRecord, TemplateArray, TemplateBehindBoard, TemplateBoardRecord, TemplateCirArray, TemplateCurveArray, TemplateEntityRef, TemplateFilletAction, TemplateKuGanRecord, TemplateLatticeRecord, TemplateLayerBoard, TemplateLeftRightBoardRecord, TemplateMaterialAction, TemplateMoveAction, TemplateParam, TemplateRecord, TemplateRectArray, TemplateRoomDoorRecord, TemplateSetSealAction, TemplateSizeBoard, TemplateStretchGripAction, TemplateStretchScaleBoxAction, TemplateTable, TemplateTopBottomBoard, TemplateVerticalBoard, TemplateVisualSpace, TemplateWindowRecord, TemplateWineRackRecord, TemplateaRadiusAction, Text, TextAligen, TextureTable, TextureTableEventBus, TextureTableRecord, ThicknessDirection, UVFullType, UVType, UpdateDraw, UpdateHoleFakerWallsAndUpdateDraw, UpdateRelevanceWallHole, UpdateTempPolyline, UpdateWallHolesDataAndUpdateDraw, ViewNearMinSize, ViewportEntity, ViewportEntity2, VisualSpaceBox, WallCurveDirType, WallFaceType, applyMixins, boardUVGenerator, boardUVGenerator2, clipperCpp, enumToArray };
//# sourceMappingURL=api.esm.js.map