pull/641/MERGE
ChenX 5 years ago
parent 10fe6ccf26
commit cf53ed66d7

@ -219,7 +219,7 @@ export function FastDrillingEdgeGeometry(radius: number, height: number): Buffer
coords.push(p.x, p.y, 0, p.x, p.y, height);//edge
}
geo.addAttribute('position', new Float32BufferAttribute(coords, 3));
geo.setAttribute('position', new Float32BufferAttribute(coords, 3));
cache2.set(key, geo);
return geo;
}

@ -110,7 +110,7 @@ export class Database
if (!this.defaultDatabase)
return;
this.DefaultMaterial = this.GetObjectId(71).Object as PhysicalMaterialRecord;
this.DefaultMaterial = this.GetObjectId(71)?.Object as PhysicalMaterialRecord ?? this.DefaultMaterial;
this.DefaultMaterial.Update();
HostApplicationServices.DefaultMeshMaterial = this.DefaultMaterial.Material;
}
@ -174,9 +174,9 @@ export class Database
if (ver > 3)
{
this.Lights.ReadFile(file);
this.AmbientLight = this.Lights.Entitys[0] as AmbientLight;
this.SunLight = this.Lights.Entitys[1] as DirectionalLight;
this.HemisphereLight = this.Lights.Entitys[2] as HemisphereLight;
this.AmbientLight = this.Lights.Entitys[0] as AmbientLight ?? this.AmbientLight;
this.SunLight = this.Lights.Entitys[1] as DirectionalLight ?? this.SunLight;
this.HemisphereLight = this.Lights.Entitys[2] as HemisphereLight ?? this.HemisphereLight;
}
else
{

@ -166,13 +166,13 @@ export function FastWireframe2(dr: ExtrudeHole, color = 0)
coords.push(p.x, p.y, height);
let edgeGeo = new BufferGeometry();
edgeGeo.addAttribute('position', new Float32BufferAttribute(edgeCoords, 3));
geo.addAttribute('position', new Float32BufferAttribute(coords, 3));
edgeGeo.setAttribute('position', new Float32BufferAttribute(edgeCoords, 3));
geo.setAttribute('position', new Float32BufferAttribute(coords, 3));
let line = new Line(geo, material);
line.applyMatrix(cu.OCS);
let edge = new LineSegments(edgeGeo, material)
let edge = new LineSegments(edgeGeo, material);
edge.applyMatrix(cu.OCS);
let result = [line, edge];

Loading…
Cancel
Save