Skip to main content
Glama

MCP 3D Printer Server

ViewportUtils.js1.03 kB
import { Fn } from '../tsl/TSLBase.js'; import { screenUV } from '../display/ScreenNode.js'; import { viewportDepthTexture } from '../display/ViewportDepthTextureNode.js'; import { linearDepth } from '../display/ViewportDepthNode.js'; /** @module ViewportUtils **/ /** * A special version of a screen uv function that involves a depth comparison * when computing the final uvs. The function mitigates visual errors when * using viewport texture nodes for refraction purposes. Without this function * objects in front of a refractive surface might appear on the refractive surface * which is incorrect. * * @method * @param {Node<vec2>?} uv - Optional uv coordinates. By default `screenUV` is used. * @return {Node<vec2>} The update uv coordinates. */ export const viewportSafeUV = /*@__PURE__*/ Fn( ( [ uv = null ] ) => { const depth = linearDepth(); const depthDiff = linearDepth( viewportDepthTexture( uv ) ).sub( depth ); const finalUV = depthDiff.lessThan( 0 ).select( screenUV, uv ); return finalUV; } );

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DMontgomery40/mcp-3D-printer-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server