MCPcopy Create free account
hub / github.com/TaewoooPark/NODEPROMPT / getPatternTexture

Function getPatternTexture

src/utils/nodePatterns.ts:90–103  ·  view source on GitHub ↗
(type: NodeType)

Source from the content-addressed store, hash-verified

88
89/** Canvas texture for 3D sphere materials */
90export function getPatternTexture(type: NodeType): THREE.CanvasTexture {
91 if (textureCache.has(type)) return textureCache.get(type)!;
92
93 const canvas = document.createElement('canvas');
94 canvas.width = SIZE;
95 canvas.height = SIZE;
96 drawPattern(canvas.getContext('2d')!, type);
97
98 const texture = new THREE.CanvasTexture(canvas);
99 texture.wrapS = THREE.RepeatWrapping;
100 texture.wrapT = THREE.RepeatWrapping;
101 textureCache.set(type, texture);
102 return texture;
103}
104
105/** CSS inline styles for 2D HTML swatches (legend, context menu) */
106export const PATTERN_CSS: Record<NodeType, CSSProperties> = {

Callers 4

SphereInstancedViewFunction · 0.90
InteriorViewFunction · 0.90
NodeMeshFunction · 0.90
DraggableNode.tsxFile · 0.90

Calls 1

drawPatternFunction · 0.85

Tested by

no test coverage detected