Skip to main content
Glama

MCP 3D Printer Server

Arrays.js1.91 kB
import StorageInstancedBufferAttribute from '../../renderers/common/StorageInstancedBufferAttribute.js'; import StorageBufferAttribute from '../../renderers/common/StorageBufferAttribute.js'; import { storage } from './StorageBufferNode.js'; import { getLengthFromType, getTypedArrayFromType } from '../core/NodeUtils.js'; /** @module Arrays **/ /** * TSL function for creating a storage buffer node with a configured `StorageBufferAttribute`. * * @function * @param {Number|TypedArray} count - The data count. It is also valid to pass a typed array as an argument. * @param {String|Struct} [type='float'] - The data type. * @returns {StorageBufferNode} */ export const attributeArray = ( count, type = 'float' ) => { let itemSize, typedArray; if ( type.isStruct === true ) { itemSize = type.layout.getLength(); typedArray = getTypedArrayFromType( 'float' ); } else { itemSize = getLengthFromType( type ); typedArray = getTypedArrayFromType( type ); } const buffer = new StorageBufferAttribute( count, itemSize, typedArray ); const node = storage( buffer, type, count ); return node; }; /** * TSL function for creating a storage buffer node with a configured `StorageInstancedBufferAttribute`. * * @function * @param {Number|TypedArray} count - The data count. It is also valid to pass a typed array as an argument. * @param {String|Struct} [type='float'] - The data type. * @returns {StorageBufferNode} */ export const instancedArray = ( count, type = 'float' ) => { let itemSize, typedArray; if ( type.isStruct === true ) { itemSize = type.layout.getLength(); typedArray = getTypedArrayFromType( 'float' ); } else { itemSize = getLengthFromType( type ); typedArray = getTypedArrayFromType( type ); } const buffer = new StorageInstancedBufferAttribute( count, itemSize, typedArray ); const node = storage( buffer, type, count ); return node; };

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