Skip to main content
Glama

optics_solid_trace

Trace rays through an STL solid with refractive index to find exit points and turn angles for molded optics, light pipes, prisms, and lenses.

Instructions

NON-SEQUENTIAL ray trace through a real solid (STL mesh) with a refractive index — the lane for molded optical parts (light-pipes, prisms, lenses). Backed by KrakenOS, which is GPL-3.0 and is run ONLY in a subprocess (the parent never imports it — same arm's-length isolation as the GPL Elmer/OpenFOAM binaries). Requires the optics_gpl extra; degrades to {ok:false, reason, install} otherwise.

Geometry: pass a model handle (exported to STL here) OR a ready stl_path. Material: glass (KrakenOS catalog name, e.g. 'BK7') or n_refractive (constant index). rays: [{origin:[x,y,z], dir:[l,m,n]}]; each ray's turn_deg is its input->exit bend (~90 for a TIR corner prism, ~0 for a straight pass). solid: {diameter, thickness, axis_move} placement. wavelength_um default 0.55. want_paths (default False): also return each valid ray's polyline as paths — the per-surface hit points [[x,y,z], ...] in the traced frame. The LAST point of each path is the ray's EXIT LOCATION on the solid, so the spatial exit/leakage map a diffuser needs can be reconstructed from it.

Returns the degradation dict, or {ok, backend:'KrakenOS (subprocess-isolated, GPL-3.0)', n_launched, n_valid, valid_fraction, mean_turn_deg, max_turn_deg, rays:[{valid, exit_dir, turn_deg}], stl_path, paths?:[[[x,y,z],...],...]}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
raysYes
glassNo
modelNo
solidNo
stl_pathNo
want_pathsNo
n_refractiveNo
wavelength_umNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden and does so thoroughly: non-sequential nature, KrakenOS backend, GPL-3.0 subprocess isolation, extra requirement, degradation dict on missing optional dependency, and the exact return structure. It also explains the meaning of turn_deg and the exit-location semantics of want_paths.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the purpose and then organizes remaining detail under Geometry, Material, rays, solid, wavelength, and returns. The length is justified by the complex eight-parameter, no-schema-description call, and every sentence adds operational meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description provides enough for correct invocation: it documents all parameters, the optional-dependency failure mode, and the full success return shape. An agent has the information needed to decide and call correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate and it does. It defines the roles of model vs stl_path, glass vs n_refractive, the rays item format, solid placement shape, wavelength default, and want_paths/paths output semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource: non-sequential ray trace through a real solid STL mesh with refractive index. The scope 'real solid (STL mesh)' clearly distinguishes it from a generic or sequential optics ray trace sibling such as optics_raytrace.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear context for use ('the lane for molded optical parts') and practical setup requirements (optics_gpl extra, degradation behavior, model vs stl_path). It does not explicitly name when to choose a sibling like optics_raytrace instead, so it stops short of full when/when-not/alternatives guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools