File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -296,14 +296,17 @@ export default function (
296296 }
297297
298298 // plot the primitives
299- elements . forEach (
300- ( element ) => scene . add ( primitiveFunctions [ element . type ] (
299+ elements . forEach ( ( element ) => {
300+ const sceneElement = primitiveFunctions [ element . type ] (
301301 element ,
302302 uniforms ,
303303 /** @type {import('./extent.js').Extent } */ ( extent ) ,
304304 container
305- ) )
306- ) ;
305+ ) ;
306+ // Primitives like https://mathics3.github.io/mathics-threejs-backend/primitives/text
307+ // don't add anything to the scene, but to the container.
308+ if ( sceneElement ) scene . add ( sceneElement ) ;
309+ } ) ;
307310
308311 const renderer = new WebGLRenderer ( {
309312 antialias : true ,
Original file line number Diff line number Diff line change 5858 * uniforms: import('../uniforms.js').UniformsBuffer,
5959 * extent: import('../extent.js').Extent,
6060 * container: HTMLElement
61- * ) => import('../../vendors/three.js').Object3D } PrimitiveFunction
61+ * ) => import('../../vendors/three.js').Object3D | null } PrimitiveFunction
6262 */
6363
6464// Note that Graphics3D includes a number of 1D and 2D kinds of
You can’t perform that action at this time.
0 commit comments