POV-Ray : Newsgroups : povray.pov4.discussion.general : Spline Editor Server Time
30 Oct 2025 18:00:40 EDT (-0400)
  Spline Editor (Message 1 to 1 of 1)  
From: Bald Eagle
Subject: Spline Editor
Date: 28 Oct 2025 14:15:00
Message: <web.690107cd51ca2fd67459de3125979125@news.povray.org>
What would be required to add a cross-platform dynamic spline modeler to povray
that would allow the addition, deletion, and editing of control points with a
mouse to povray?
Copilot said:


Reasoned for 28s


Outlining development paths


built‑in interactive modeling API. You either (A) build a companion,
cross‑platform spline modeler that writes POV‑Ray SDL (and
optionally auto‑re‑renders via the CLI), or (B) contribute to an
existing DCC host (e.g., the Blender ↔ POV‑Ray exporter) to get a
first‑class interactive experience and keep POV‑Ray as the renderer.
Below is a concrete, technical blueprint with specific POV‑Ray features



Spline‑based geometry you will feed from an editor:

quadratic_spline, cubic_spline, bezier_spline, plus linear_sweep|conic_sweep.
povray
+2
Lathe: 2‑D curve rotated about the y‑axis; supports the same spline
modes.
povray
+1
Sphere_sweep: tubular geometry defined by centers + radii along
linear|b_spline|cubic_spline.
povray
+1

linear|quadratic|cubic|natural_spline.
povray


mouse interactivity inside POV‑Ray.
povray
+1
Execution model: POV‑Ray renders from files; the Windows build has some
special CLI flags (e.g., /RENDER, /EXIT) for automation; Unix builds are

for an interactive editor embedded in the core.
povray
+2
Implication: the most practical way is a separate, cross‑platform UI app
that edits control points and writes an include file the scene uses, then spawns
POV‑Ray to re‑render. (This is what legacy tools like Epspline did
for prism/lathe editing.)
mit



1) UI & platform stack
Framework: Qt 6 (Widgets or QML) or Dear ImGui + SDL2; both are truly
cross‑platform (Win/macOS/Linux) and provide mouse picking, viewport
widgets, file dialogs.
Viewport: OpenGL/Vulkan for fast redraw of control polygons and curve previews.

C++ wrapper; many language bindings) so you get robust operations (knot
insertion, evaluation, degree elevate/reduce, reparametrization, serialization).
github
+1
2) Geometry mapping to POV‑Ray
Lathe (rotate 2‑D profile around y): export control points in 2‑D
order with the proper spline tag


povray



povray
+1
Sphere_sweep: export a list of centers + radii and your chosen interpolation
(linear_spline|b_spline|cubic_spline).
povray
Path splines: for cameras or animated controllers, output an SDL spline { ... }
for linear|quadratic|cubic|natural_spline.
povray
Provide a simple include contract, e.g., generate model_splines.inc with
#declare A1D_PROFILE=array[N]{<x,z>,...}; lathe{ cubic_spline N, A1D_PROFILE[0]

povray
+1


Export: save the include and a small scene INI.
Render: spawn POV‑Ray headless (pvengine.exe /RENDER file.pov /EXIT on
Windows; povray +Ifile.pov +H720 +W1280 ... on Unix/macOS). Show the rendered
image back in the app.
povray
+1
Hot‑reload: on every point edit (mouse drag/drop, add/delete), rewrite the
include and re‑invoke POV‑Ray at low resolution for a fast preview,
then optionally a full‑res pass on idle. (This mirrors what Epspline did:
a drawing canvas + POV settings + SDL export).
mit
4) File I/O & robustness

serialization if convenient.
github
When targeting prism/lathe: enforce closing semantics (linear auto‑closes,
others require explicit closure), and for prism warn the user the curve lives in

povray
For sphere_sweep: validate minimum number of spheres by mode (≥2 for
linear, ≥4 for b_spline/cubic_spline), and expose the tolerance knob if
users see self‑shadowing.
povray
5) Packaging & licensing
Ship as a separate application (no POV‑Ray code inside). Users point the
app to their POV‑Ray binary and libraries. This avoids re‑licensing
the renderer. (POV‑Ray 3.7+ source is under AGPL‑3.0;
bundling/derivatives of the core would pull you into AGPL obligations.)
github
+2

reinventing a modeler
Blender already provides interactive splines, curve objects, and rich mouse

Blender 4.x that writes POV code, supports many primitives, and lets you add
custom POV code where needed.
povray
+1
Users install POV‑Ray, enable the exporter add‑on, and render from
Blender; you can capture the generated .pov for inspection and
command‑line use.
stackexchange
If your primary goal is point‑and‑click spline editing, this path is
the least engineering effort and gives you modeling, snapping, transform tools,
and packaging for free.
blender

Scope checklist: what your modeler must implement
Interactive editing

Add/delete/move control points with handles; toggle open/closed curves; degree
(linear/quadratic/cubic) and B‑spline/Bezier mode; for NURBS, allow
per‑point weights (export as sampled points or rational → Bezier
conversion for POV targets). (Use TinySpline ops for knot insertion, elevation,
etc.)
github
Snapping & constraints (grid, angle, symmetry), curve reparameterization,
arc‑length sampling for even sweep tessellation (if you export mesh
fallbacks).
github
POV‑Ray export adapters


→ sweep y) with correct closure per spline type.
povray
+1
Sphere_sweep exporter (centers + radii, correct mode/tolerance).
povray
Optional: Bicubic patch / mesh2 fallback for shapes that do not map neatly to
lathe/prism.
Render integration



povray
+1
Include eco‑system

Generate a stable #declare API; e.g., #declare A1D_PROFILE = array[...] for
lathe, #declare A2D_SWEEP = array[...] for sphere_sweep; the main scene does
#include "model_splines.inc". (POV‑Ray can read files via #fopen/#read
too, but simple #include keeps scenes deterministic.)
povray
QA on spline semantics


(non‑linear splines are not auto‑closed). Provide on‑canvas
warnings before export.
povray
+1
If you really want it inside POV‑Ray



to add an event loop, mouse input, and an interactive canvas. The Unix
documentation/source indicates the Unix build is a console app with optional
SDL/text preview; adding a cross‑platform GUI means substantial changes in
the VFE layer and new display backends.
deepwiki
+1

editor state, plus a way to regenerate SDL and re‑invoke the internal
parser on change.

comply with AGPL‑3.0 (source distribution of your modified renderer,

external and just call the official POV‑Ray binary.
github
+1

Blender+POV exporter, not to rewrite POV‑Ray as a modeler.




Pick Qt 6 + OpenGL; integrate TinySpline (CMake/Conan/NuGet help available).
github
+2

add/delete/move; toggle spline type.


Emit model_splines.inc; small driver .pov and .ini.
Implement spawn‑and‑preview for Windows (/RENDER, /EXIT) and Unix
(povray +I...).
povray
+1


3‑D editor for centers/radii; length‑based resampling; tolerance
control.
povray
Status panel with POV‑Ray warnings (e.g., non‑closed cubic spline).
povray


NURBS weights in the editor (export hybrid: sample to cubic/Bezier when POV
primitive does not support NURBS).

render there.
povray
+1
Prior art you can study
Epspline, a GUI tool specifically for POV‑Ray prism/lathe editing,

emulate.
mit

for exporting POV primitives, including splines, custom code hooks, and
command‑line integration.
povray
+1
Quick prototype snippet (what your app would write)



Plain Text


// model_splines.inc (generated)
#declare A1D_LatheProfile = array[6] { <0,0>, <1,1>, <3,2>, <2,3>, <2,4>, <0,4>
};
#declare OBJ_Lathe =
lathe {
  cubic_spline
  6,
  A1D_LatheProfile[0], A1D_LatheProfile[1], A1D_LatheProfile[2],
  A1D_LatheProfile[3], A1D_LatheProfile[4], A1D_LatheProfile[5]
  pigment { color rgb <0.8,0.8,0.9> }
}





Plain Text


#include "model_splines.inc"
camera { location <0, -10, 4> look_at 0 }
light_source { <30,-40,50> rgb 1 }
object { OBJ_Lathe }

splines require explicit closure if you want a closed profile.)
povray

Bottom line
Fastest path: a separate, cross‑platform editor that exports .inc + spawns
POV‑Ray.

interactive modeler.
povray
+1

re‑engineering and AGPL compliance.
deepwiki
+1


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.