UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

27 lines (26 loc) 626 B
"use strict"; import { FrontSide, LineBasicMaterial, MeshStandardMaterial } from "three"; export const step = 1e-6; const MESH_MAT = new MeshStandardMaterial({ color: 16777215, // vertexColors: true, side: FrontSide, metalness: 0, roughness: 0.9 }); const LINES_MAT = new LineBasicMaterial({ color: 16777215, linewidth: 1 // vertexColors: true, }); export function csgMaterialMesh(color, wireframe) { const mat = MESH_MAT.clone(); mat.wireframe = wireframe; mat.color = color; return mat; } export function csgMaterialLine(color) { const mat = LINES_MAT.clone(); mat.color = color; return mat; }