|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
import { BoxGeometry, BufferGeometry, ExtrudeGeometry, ExtrudeGeometryOptions, LineSegments, Matrix3, Matrix4, Mesh, Object3D, Path, Vector3, Line as TLine } from "three";
|
|
|
|
|
import { BoxGeometry, BufferGeometry, ExtrudeGeometry, ExtrudeGeometryOptions, LineSegments, Matrix3, Matrix4, Mesh, Object3D, Path, Vector3, Line as TLine, Geometry } from "three";
|
|
|
|
|
import { Line2 } from "three/examples/jsm/lines/Line2";
|
|
|
|
|
import { arrayClone, arrayLast, arrayRemoveIf, arrayRemoveOnce, arraySortByNumber, arraySum } from "../../Common/ArrayExt";
|
|
|
|
|
import { ColorMaterial } from "../../Common/ColorPalette";
|
|
|
|
@ -20,7 +20,7 @@ import { GenerateExtrudeEdgeGeometry } from "../../Geometry/ExtrudeEdgeGeometry"
|
|
|
|
|
import { ExtrudeGeometryBuilder } from "../../Geometry/ExtrudeEdgeGeometry2";
|
|
|
|
|
import { AsVector2, AsVector3, equaln, equalv2, equalv3, IdentityMtx4, isIntersect, isParallelTo, isPerpendicularityTo, MoveMatrix, XAxis, YAxis, ZAxis, ZeroVec } from "../../Geometry/GeUtils";
|
|
|
|
|
import { OBB } from "../../Geometry/OBB/obb";
|
|
|
|
|
import { ScaleUV } from "../../Geometry/UVUtils";
|
|
|
|
|
import { ScaleUV, ScaleUV2 } from "../../Geometry/UVUtils";
|
|
|
|
|
import { RenderType } from "../../GraphicsSystem/RenderType";
|
|
|
|
|
import { BlockTableRecord } from "../BlockTableRecord";
|
|
|
|
|
import { CADFactory, Factory } from "../CADFactory";
|
|
|
|
@ -38,6 +38,7 @@ import { Entity } from "./Entity";
|
|
|
|
|
import { Polyline } from "./Polyline";
|
|
|
|
|
import { Region } from "./Region";
|
|
|
|
|
import { Line } from "./Line";
|
|
|
|
|
import { PhysicalMaterialRecord } from "../PhysicalMaterialRecord";
|
|
|
|
|
|
|
|
|
|
export type ExtureContourCurve = Polyline | Circle;
|
|
|
|
|
export type ExtureContour = Polyline | Circle | ExtrudeSolid | Region;
|
|
|
|
@ -1613,7 +1614,7 @@ export class ExtrudeSolid extends Entity
|
|
|
|
|
};
|
|
|
|
|
let geo = new ExtrudeGeometry(shape.Shape, extrudeSettings);
|
|
|
|
|
geo.applyMatrix4(contour.OCSNoClone);
|
|
|
|
|
ScaleUV(geo);
|
|
|
|
|
this.UpdateUV(geo, contour.OCSNoClone);
|
|
|
|
|
let bgeo = new BufferGeometry().fromGeometry(geo);
|
|
|
|
|
this._MeshGeometry = bgeo;
|
|
|
|
|
return bgeo;
|
|
|
|
@ -1674,7 +1675,19 @@ export class ExtrudeSolid extends Entity
|
|
|
|
|
this.MeshGeometry;
|
|
|
|
|
return this._EdgeGeometry;
|
|
|
|
|
}
|
|
|
|
|
UpdateUV(geo: Geometry, ocs: Matrix4, isRev = false)
|
|
|
|
|
{
|
|
|
|
|
let mat: PhysicalMaterialRecord;
|
|
|
|
|
if (this.Material && this.Material.Object)
|
|
|
|
|
mat = this.Material.Object as PhysicalMaterialRecord;
|
|
|
|
|
else
|
|
|
|
|
mat = this.Db?.DefaultMaterial;
|
|
|
|
|
|
|
|
|
|
if (mat && mat.IsFull)
|
|
|
|
|
ScaleUV2(geo, ocs, this.width, this.height, isRev);
|
|
|
|
|
else
|
|
|
|
|
ScaleUV(geo);
|
|
|
|
|
}
|
|
|
|
|
DeferUpdate()
|
|
|
|
|
{
|
|
|
|
|
if (this.NeedUpdateFlag & UpdateDraw.Matrix)
|
|
|
|
@ -1682,7 +1695,6 @@ export class ExtrudeSolid extends Entity
|
|
|
|
|
if (this.RelevanceKnifs.some(id => !id.IsErase))
|
|
|
|
|
this.NeedUpdateFlag |= UpdateDraw.Geometry;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
super.DeferUpdate();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1734,7 +1746,6 @@ export class ExtrudeSolid extends Entity
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UpdateDrawObjectMaterial(renderType: RenderType, obj: Object3D)
|
|
|
|
|
{
|
|
|
|
|
if (renderType === RenderType.Wireframe)
|
|
|
|
|