diff --git a/packages/base/src/3dview/helpers.ts b/packages/base/src/3dview/helpers.ts index 972a4121..a9be9d8d 100644 --- a/packages/base/src/3dview/helpers.ts +++ b/packages/base/src/3dview/helpers.ts @@ -114,13 +114,15 @@ export function buildShape(options: { clippingPlanes: THREE.Plane[]; selected: boolean; isSolid: boolean; + isWireframe: boolean; objColor?: THREE.Color | string | number; }): { meshGroup: THREE.Group; mainMesh: THREE.Mesh; edgesMeshes: LineSegments2[]; } | null { - const { objName, data, isSolid, clippingPlanes, objColor } = options; + const { objName, data, isSolid, isWireframe, clippingPlanes, objColor } = + options; const { faceList, edgeList, jcObject } = data; const vertices: Array = []; @@ -158,7 +160,7 @@ export function buildShape(options: { // it's too bad Three.js does not easily allow setting uniforms independently per-mesh const material = new THREE.MeshStandardMaterial({ color: new THREE.Color(color), - wireframe: false, + wireframe: isWireframe, flatShading: false, clippingPlanes, metalness: 0.5, diff --git a/packages/base/src/3dview/mainview.tsx b/packages/base/src/3dview/mainview.tsx index b859e155..3236dc9c 100644 --- a/packages/base/src/3dview/mainview.tsx +++ b/packages/base/src/3dview/mainview.tsx @@ -707,6 +707,7 @@ export class MainView extends React.Component { const selected = selectedNames.includes(objName); const obj = this._model.sharedModel.getObjectByName(objName); const objColor = obj?.parameters?.Color; + const isWireframe = this.state.wireframe; // TODO Have a more generic way to spot non-solid objects const isSolid = !( @@ -719,6 +720,7 @@ export class MainView extends React.Component { clippingPlanes: this._clippingPlanes, selected, isSolid, + isWireframe, objColor });