Skip to main content
Glama

MCP 3D Printer Server

Text2D.js1.04 kB
import { DoubleSide, Mesh, MeshBasicMaterial, PlaneGeometry, Texture } from 'three'; function createText( message, height ) { const canvas = document.createElement( 'canvas' ); const context = canvas.getContext( '2d' ); let metrics = null; const textHeight = 100; context.font = 'normal ' + textHeight + 'px Arial'; metrics = context.measureText( message ); const textWidth = metrics.width; canvas.width = textWidth; canvas.height = textHeight; context.font = 'normal ' + textHeight + 'px Arial'; context.textAlign = 'center'; context.textBaseline = 'middle'; context.fillStyle = '#ffffff'; context.fillText( message, textWidth / 2, textHeight / 2 ); const texture = new Texture( canvas ); texture.needsUpdate = true; const material = new MeshBasicMaterial( { color: 0xffffff, side: DoubleSide, map: texture, transparent: true, } ); const geometry = new PlaneGeometry( ( height * textWidth ) / textHeight, height ); const plane = new Mesh( geometry, material ); return plane; } export { createText };

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