How to edit mesh in game time - CSG system

I’ve been working on a Constructive Solid Geometry (CSG) system that runs entirely at game time inside Delightex Edu and Delightex Nova.

Note: Mesh complexity determines the execution time for CSG operations; this process typically takes about 2–3 minutes for complex meshes.

The goal is to bring real-time solid modeling into a platform that doesn’t normally provide a native CSG system.

Instead of creating and editing the geometry before importing it, this system can take multiple 3D solids and perform operations such as:

  • Union — combine two solids

  • Difference — subtract one solid from another

  • Intersection — keep only the overlapping volume

The resulting geometry is generated during runtime and can then be used by the game.

This project is the external of How to create arbitrary triangle ( a polygon ) in-game-time! - #4 by HenryHuy

Setup & Usage

  • Files :

Test.txt (924 Bytes)

Polygon.txt (12.1 KB)

ModelLoader.txt (13.1 KB)

Geometry.txt (17.6 KB)

to use these file you need to copy-paste all these file into your typescript file .
example usage are in the test.txt file
you need to call these function to perform subtract , union , mask

union_model(triangles_a_world,triangles_b_world,new Color(0,255,0));
sub_model(triangles_a_world,triangles_b_world,new Color(255,0,0));
mask_model(triangles_a_world,triangles_b_world,new Color(0,0,255));

Currently its only available for single color no textures .

footage:
union:

subtract:

mask:

obj.txt (1.3 MB)
im forgot the obj file.
Note : You can import any obj file by convert it into text