33 */
44
55import * as THREE from 'three'
6- import { StandardMaterial } from './standardMaterial'
6+ import { StandardMaterial , createOpaque , createTransparent } from './standardMaterial'
77import { createMaskMaterial } from './maskMaterial'
88import { createIsolationMaterial } from './isolationMaterial'
99import { OutlineMaterial } from './outlineMaterial'
10- import { Settings } from '../../vim-webgl-viewer/viewerSettings'
10+ import { ViewerSettings } from '../../vim-webgl-viewer/settings /viewerSettings'
1111import { MergeMaterial } from './mergeMaterial'
12+ import { createSimpleMaterial } from './simpleMaterial'
1213import { SignalDispatcher } from 'ste-signals'
1314
1415/**
@@ -29,19 +30,23 @@ export class ViewerMaterials {
2930 }
3031
3132 /**
32- * Material used for opaque model geometry
33+ * Material used for opaque model geometry.
3334 */
3435 opaque : StandardMaterial
3536 /**
36- * Material used for transparent model geometry
37+ * Material used for transparent model geometry.
3738 */
3839 transparent : StandardMaterial
3940 /**
40- * Material used when creating wireframe geometry of the model
41+ * Material used for maximum performance.
42+ */
43+ simple : THREE . Material
44+ /**
45+ * Material used when creating wireframe geometry of the model.
4146 */
4247 wireframe : THREE . LineBasicMaterial
4348 /**
44- * Material used to show traces of hidden objects
49+ * Material used to show traces of hidden objects.
4550 */
4651 isolation : THREE . Material
4752 /**
@@ -69,15 +74,16 @@ export class ViewerMaterials {
6974 constructor (
7075 opaque ?: StandardMaterial ,
7176 transparent ?: StandardMaterial ,
77+ simple ?: THREE . Material ,
7278 wireframe ?: THREE . LineBasicMaterial ,
7379 isolation ?: THREE . Material ,
7480 mask ?: THREE . ShaderMaterial ,
7581 outline ?: OutlineMaterial ,
76- merge ?: MergeMaterial ,
77- grid ?: THREE . ShaderMaterial
82+ merge ?: MergeMaterial
7883 ) {
79- this . opaque = opaque ?? new StandardMaterial ( createOpaque ( ) )
80- this . transparent = transparent ?? new StandardMaterial ( createTransparent ( ) )
84+ this . opaque = opaque ?? createOpaque ( )
85+ this . transparent = transparent ?? createTransparent ( )
86+ this . simple = simple ?? createSimpleMaterial ( )
8187 this . wireframe = wireframe ?? createWireframe ( )
8288 this . isolation = isolation ?? createIsolationMaterial ( )
8389 this . mask = mask ?? createMaskMaterial ( )
@@ -87,9 +93,9 @@ export class ViewerMaterials {
8793
8894 /**
8995 * Updates material settings based on the provided configuration.
90- * @param {Settings } settings - The settings to apply to the materials.
96+ * @param {ViewerSettings } settings - The settings to apply to the materials.
9197 */
92- applySettings ( settings : Settings ) {
98+ applySettings ( settings : ViewerSettings ) {
9399 this . isolationOpacity = settings . materials . isolation . opacity
94100 this . isolationColor = settings . materials . isolation . color
95101
@@ -325,31 +331,6 @@ export class ViewerMaterials {
325331 }
326332}
327333
328- /**
329- * Creates a new instance of the default loader opaque material.
330- * @returns {THREE.MeshPhongMaterial } A new instance of MeshPhongMaterial with transparency.
331- */
332- export function createOpaque ( ) {
333- return new THREE . MeshPhongMaterial ( {
334- color : 0x999999 ,
335- vertexColors : true ,
336- flatShading : true ,
337- side : THREE . DoubleSide ,
338- shininess : 5
339- } )
340- }
341-
342- /**
343- * Creates a new instance of the default loader transparent material.
344- * @returns {THREE.MeshPhongMaterial } A new instance of MeshPhongMaterial with transparency.
345- */
346- export function createTransparent ( ) {
347- const mat = createOpaque ( )
348- mat . transparent = true
349- mat . shininess = 70
350- return mat
351- }
352-
353334/**
354335 * Creates a new instance of the default wireframe material.
355336 * @returns {THREE.LineBasicMaterial } A new instance of LineBasicMaterial.
0 commit comments