|
|
@ -38,6 +38,7 @@ import { DragPointType } from "./DragPointType";
|
|
|
|
import { Ellipse } from "./Ellipse";
|
|
|
|
import { Ellipse } from "./Ellipse";
|
|
|
|
import { Entity } from "./Entity";
|
|
|
|
import { Entity } from "./Entity";
|
|
|
|
import { ExtrudeConfig } from "./ExtrudeConfig";
|
|
|
|
import { ExtrudeConfig } from "./ExtrudeConfig";
|
|
|
|
|
|
|
|
import { GenUVForWorld } from './GenUVForWorld';
|
|
|
|
import { Line } from "./Line";
|
|
|
|
import { Line } from "./Line";
|
|
|
|
import { Polyline } from "./Polyline";
|
|
|
|
import { Polyline } from "./Polyline";
|
|
|
|
import { Region } from "./Region";
|
|
|
|
import { Region } from "./Region";
|
|
|
@ -118,6 +119,11 @@ export class ExtrudeSolid extends Entity
|
|
|
|
let isf_new = Boolean((materialId?.Object as PhysicalMaterialRecord)?.IsFull);
|
|
|
|
let isf_new = Boolean((materialId?.Object as PhysicalMaterialRecord)?.IsFull);
|
|
|
|
if (isf_old !== isf_new)
|
|
|
|
if (isf_old !== isf_new)
|
|
|
|
this.Update();
|
|
|
|
this.Update();
|
|
|
|
|
|
|
|
else if ((materialId?.Object as PhysicalMaterialRecord)?.UseWorldUV)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (this._MeshGeometry)
|
|
|
|
|
|
|
|
this.GenWorldUV(this._MeshGeometry);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
get Material() { return super.Material; }
|
|
|
|
get Material() { return super.Material; }
|
|
|
@ -1857,6 +1863,7 @@ export class ExtrudeSolid extends Entity
|
|
|
|
let bgeo = new BufferGeometry().fromGeometry(geo);
|
|
|
|
let bgeo = new BufferGeometry().fromGeometry(geo);
|
|
|
|
bgeo["IsMesh"] = true;
|
|
|
|
bgeo["IsMesh"] = true;
|
|
|
|
this._MeshGeometry = bgeo;
|
|
|
|
this._MeshGeometry = bgeo;
|
|
|
|
|
|
|
|
this.GenWorldUV(bgeo);
|
|
|
|
return bgeo;
|
|
|
|
return bgeo;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1866,6 +1873,7 @@ export class ExtrudeSolid extends Entity
|
|
|
|
if (grooves.length < MaxDrawGrooveCount)
|
|
|
|
if (grooves.length < MaxDrawGrooveCount)
|
|
|
|
this._EdgeGeometry = builder.EdgeGeometry;
|
|
|
|
this._EdgeGeometry = builder.EdgeGeometry;
|
|
|
|
this.UpdateUV(null, null);
|
|
|
|
this.UpdateUV(null, null);
|
|
|
|
|
|
|
|
this.GenWorldUV(this._MeshGeometry);
|
|
|
|
|
|
|
|
|
|
|
|
return this._MeshGeometry;
|
|
|
|
return this._MeshGeometry;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1903,13 +1911,9 @@ export class ExtrudeSolid extends Entity
|
|
|
|
|
|
|
|
|
|
|
|
UpdateUV(geo: Geometry, ocs: Matrix4, isRev = false)
|
|
|
|
UpdateUV(geo: Geometry, ocs: Matrix4, isRev = false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let mat: PhysicalMaterialRecord;
|
|
|
|
let mtl = (this.Material?.Object as PhysicalMaterialRecord) ?? this.Db?.DefaultMaterial;
|
|
|
|
if (this.Material && this.Material.Object)
|
|
|
|
|
|
|
|
mat = this.Material.Object as PhysicalMaterialRecord;
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
mat = this.Db?.DefaultMaterial;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mat && mat.IsFull)
|
|
|
|
if (mtl?.IsFull)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (geo)
|
|
|
|
if (geo)
|
|
|
|
ScaleUV2(geo, ocs, this.width, this.height, isRev);
|
|
|
|
ScaleUV2(geo, ocs, this.width, this.height, isRev);
|
|
|
@ -1922,6 +1926,18 @@ export class ExtrudeSolid extends Entity
|
|
|
|
ScaleUV(geo);
|
|
|
|
ScaleUV(geo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GenWorldUV(geo: BufferGeometry)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let mtl = (this.Material?.Object as PhysicalMaterialRecord) ?? this.Db?.DefaultMaterial;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mtl?.UseWorldUV)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let gen = new GenUVForWorld;
|
|
|
|
|
|
|
|
gen.GenGeoUV(geo, mtl.Material);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
UpdateBufferGeometryUvs(isRev: boolean)
|
|
|
|
UpdateBufferGeometryUvs(isRev: boolean)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let uvs = this._MeshGeometry.attributes.uv;
|
|
|
|
let uvs = this._MeshGeometry.attributes.uv;
|
|
|
|