MCPcopy Create free account
hub / github.com/CNCKitchen/stlTexturizer / createRing

Function createRing

js/viewer.js:934–960  ·  view source on GitHub ↗
(axis, color)

Source from the content-addressed store, hash-verified

932 depthTest: !xray,
933 polygonOffset: !xray,
934 polygonOffsetFactor: -1,
935 polygonOffsetUnits: -1,
936 });
937 const mesh = new THREE.Mesh(overlayGeo, mat);
938 mesh.renderOrder = 1;
939 _diagFaces.push(mesh);
940 scene.add(mesh);
941 requestRender();
942}
943
944// ── Rotation Gizmo ───────────────────────────────────────────────────────────
945
946let _rotGizmoGroup = null; // THREE.Group holding the 3 rings
947let _rotGizmoVisible = false;
948let _rotGizmoDragging = null; // { axis: 'x'|'y'|'z', startAngle, startPointer }
949let _rotGizmoCallback = null; // function(axis, deltaDegreesIncremental) called during drag
950const _gizmoRaycaster = new THREE.Raycaster();
951const GIZMO_COLORS = { x: 0xff3333, y: 0x33dd55, z: 0x4488ff };
952const GIZMO_HOVER_COLORS = { x: 0xff8888, y: 0x88ff99, z: 0x88bbff };
953
954function _buildRotGizmo() {
955 if (_rotGizmoGroup) return;
956 _rotGizmoGroup = new THREE.Group();
957 _rotGizmoGroup.renderOrder = 100;
958
959 const createRing = (axis, color) => {
960 // Visible ring
961 const geo = new THREE.TorusGeometry(1, 0.02, 12, 64);
962 const mat = new THREE.MeshBasicMaterial({
963 color,

Callers 1

_buildRotGizmoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected