Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
376 changes: 110 additions & 266 deletions lib/python/rs274/glcanon.py

Large diffs are not rendered by default.

762 changes: 92 additions & 670 deletions lib/python/rs274/glcanon_bake.py

Large diffs are not rendered by default.

315 changes: 0 additions & 315 deletions lib/python/rs274/glcanon_batch.py

This file was deleted.

20 changes: 10 additions & 10 deletions lib/python/rs274/glcanon_gl.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@
import numpy.typing as npt

from rs274.glcanon_bake import (ATTR_DTYPE, FLOATS_PER_VERTEX, KIND_MASK,
LineRanges, MeshVerts, PLANE_DTYPE,
PaletteRGBA, TRAJ_FLOATS_PER_VERTEX,
TrajectoryVerts, WideVerts)
LineRanges, MeshVerts, PALETTE_SIZE,
PLANE_DTYPE, PaletteRGBA,
TRAJ_FLOATS_PER_VERTEX, TrajectoryVerts,
WideVerts)

# PyOpenGL's enum constants are int subclasses, so this is honest rather than
# decorative: it says "one of the GL_* names" where a bare ``int`` would say
Expand Down Expand Up @@ -226,12 +227,11 @@ def primitive_mode(name: str | None,
except KeyError:
raise ValueError("unknown primitive mode %r" % (name,))

# Palette slots. Four cover the program's categories; the live backplot needs
# six (one per motion type the position logger distinguishes), so the array is
# eight - the next size that costs nothing to reason about and leaves room. A
# vec4[8] uniform array is 128 bytes. ``PaletteRGBA``, imported above, is the
# array as a type.
PALETTE_SIZE = 8
# Palette slots. ``PALETTE_SIZE``, imported above, is the count: four cover the
# program's categories and the live backplot needs six (one per motion type the
# position logger distinguishes), so the array is eight - the next size that
# costs nothing to reason about and leaves room. A vec4[8] uniform array is 128
# bytes. ``PaletteRGBA``, also imported, is the array as a type.


_GL_ERROR_NAMES = {
Expand Down Expand Up @@ -1695,7 +1695,7 @@ def __init__(self) -> None:
self.buffers: dict[str, Any] = {}

def upload(self, parts: Sequence[dict[str, Any]]) -> None:
"""Upload the baked program (from glcanon_bake.bake_program).
"""Upload the baked program (from glcanon_bake.program_parts).

Each part gets its own buffer, keyed by name. A part with no chain
table - the dwell markers - draws as one ``glDrawArrays`` in its own
Expand Down
2 changes: 1 addition & 1 deletion src/emc/rs274ngc/Submakefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ TARGETS += ../lib/librs274.so ../lib/librs274.so.0
@rm -f $@
$(CXX) -g $(LDFLAGS) $(PYTHON_EXTRA_LDFLAGS) -Wl,-soname,$(notdir $@) -shared -o $@ $^ -lstdc++ $(BOOST_PYTHON_LIB) $(PYTHON_LIBS) $(PYTHON_EXTRA_LIBS)

GCODEMODULESRCS := emc/rs274ngc/gcodemodule.cc
GCODEMODULESRCS := emc/rs274ngc/gcodemodule.cc emc/rs274ngc/gcode_renderer.cc
PYSRCS += $(GCODEMODULESRCS)
Comment thread
grandixximo marked this conversation as resolved.

GCODEMODULE := ../lib/python/gcode.so
Expand Down
Loading