Skip to content

Strategy request: Target block coding at OpenSCAD capabilities #326

@goatchurchprime

Description

@goatchurchprime

What Happened

Godot now has the same CSG (Computational Solid Geometry) engine as OpenSCAD. The reason OpenSCAD is so widely known and used is it solves a real problem of being able to quickly generate shapes for 3D printing with a gentle learning curve. (However, speaking from experience, things get unmaintainably complex once you go much further.)

Block coding would be an perfect interface to this CSG engine, and the result would be more tangible since the operations are expressed in the Godot node-tree where they are easy to tinker with.

I've managed to implement a basic demo of the Menger Sponge using codeblocks (see below) without too many contrived functions at the top level called EXF.

The extra features I need to make this work properly are:

  • Function calls with arguments
  • Creating and parenting of new CSG nodes
  • Setting and getting of CSG attributes (the library currently only handles Node2Ds as a special case)

To get round this I have called into EXF level functions push_s() and pop_s() to implement a stack due to the lack of local function variables, and create_csg() to make a new object, push_child() to parent the last object under the previous one, duplicate_push_last() a contrived compound function for this case, and set_last_orientation().

Once you can do function calls, the EXF level functions are a good place to stage any features in order to discover what is minimal.

I note that function names are text lines, while variables are drag and drop. It's not clear how to reconcile this. Although the text lines are more versatile, the drag and drop of names in bubbles is satisfying. An in-between method is to drag a bubble onto a text line to fill that text line.

Screenshot from 2024-12-05 10-30-50
Screenshot from 2024-12-05 10-32-10

How to Reproduce

Project is here csgmanifoldcodeblockstest.zip

Block Coding Plugin Version

v0.7.1

Godot Engine Version

v4.4.dev7 (not yet released)

Operating System

Linux

Logs or command-line output

N/A

Anything else?

My long term goal is to find something as effective as Protoflux in [Resonite](https://resonite.com/features.html] where I often see multiple people working socially on the same complex visual script in VR.

Doing this for the generation of CSG objects that are to be 3D printed is an achievable goal where there is a realistic and good possibility of it becoming a notable success.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions