Reference

Common Pitfalls

Diagnose silent drawing overruns, stale geometry, history-scope errors, camera targeting mistakes, update misuse, and unexpectedly expensive lighting.

Updated Publisher Alien_AlgorithmsPine Script v6

Drawing problems

SymptomCauseFix
Manual labels or lines disappearThey were created before render cleared the drawing pool.Create manual drawings after the Pine3D render call.
Geometry is silently missingA polyline, line, label, or face budget was exceeded.Use a budget table, lower maxFaces, reduce contour levels, or simplify overlays.
Scene times outCPU cost exceeded the per-bar limit.Lower occlusionRaster first, then face count and primitive resolution.
Silent failure is normal for drawing budgets
TradingView can drop overflow drawings without an exception. Missing geometry is often a budget issue rather than a projection bug.

Update and cache problems

SymptomFix
updateSurface or updateBars has inconsistent history dataCalculate history operators, ta calls, and request.security at global scope.
Direct vertex edits do not appearCall mesh.invalidateCache() after writing mesh.vertices.
Broad low-level changes leave stale outputCall scene.invalidateAllCaches().
A dynamic scene keeps allocating drawingsBuild geometry once and mutate existing objects.

Camera and tag mistakes

Camera will not aim at coordinates

scene.lookAt() accepts a mesh tag. Use scene.camera.lookAt(x, y, z) or a Vec3 for coordinates.

remove(tag) deleted the wrong primitive

Tag removal searches meshes, labels, lines, then polylines. Keep tags unique across types.

Rotation looks wrong

Mesh rotation methods use degrees. Vec3 rotation methods use radians.

Trail3D and Bars3D issues

SymptomExplanation
Trail capacity stops growingTrail3D clamps capacity to 300 samples.
Bar labels duplicate or consume budgetbarLabels() was called more than once. Call it only during build.
Bar values do not refreshUse updateBars() with globally computed values.
Trail is empty at startupIt has not reached enough confirmed samples to form its path.

Lighting performance

Point lights do not use the directional shadow-grid acceleration structure. Switch to directional light, reduce shadow-casting faces, or disable cast shadows on nonessential meshes.

Pine3D is a graphical rendering library for Pine Script. TradingView drawing, execution, and publication limits still apply. © Alien_Algorithms.