In-experience Constructive Solid Geometry (CSG) APIs now available in published experiences [Beta]

Anchord, WeldConstraint. What do you expect?

5 Likes

What did he use in the video for those items to break? Can that be applied to glass for realistic glass breaking too?

4 Likes

Has the engine been made faster in any way? Such as if you keep subtracting/adding to the same part, it doesn’t get so slow the more you do it.

5 Likes

Yes, through Incremental Remeshing. There’s an example in the beta post!

6 Likes

The new API is really cool, but I wish it had a way to preserve attachments that aren’t used by physics constraints. It’s very challenging to properly preserve attachments used for effects like beams, particle emitters, and scripts since they go away with the original part.

6 Likes

Good features, Can see them becoming useful in lots of situations

3 Likes

Is there any way to get the removed geometry with the new API?

11 Likes

This would be really useful. Having some “SplitOperation” or “SliceOperation” that gives both the removed geometry and remaining geometry as separate parts would be amazing, without actually destroying any material. We could fracture objects using this.

4 Likes

Is this still only available on the server or is there client support too now?

5 Likes

Awesome update! I will be able to make cool things with this, thats for sure.

4 Likes

This will allow a whole new wave of destruction on ROBLOX… That is awesome!

5 Likes

There are a couple of points in this post:

  1. Currently there is no parallelization support in CSG. This is not because CSG itself has issues but from a global resource point of view (we are looking into changing that)
  2. Crashes: I certainly hope they don’t happen
  3. Errors: They should all be catchable with pcall to prevent it from taking down your script (we are working on reducing those even more)

(more improvements coming soon ™ )

6 Likes

If you just want the removed part, you’re looking for the Intersect API. If you want both at the same time, we don’t currently have an API for it but it is something we’ve discussed previously

8 Likes

yes but there is no replication back to the server and (currently) the CSG operations have to start on the client. In other words you can’t do a CSG Operation on server and continue it on client (foreshadowing)

3 Likes

I’m going to be honest, this use case was brought to our attention very late in the studio beta process. That being said, we are looking to add an API for attachments that are not connected to a constraint

5 Likes

yes. Significantly faster (you can see a lathe demo on the linked studio beta post). Also, more speedups coming soon™)

2 Likes

Is there a use case for optimization of randomly generated stuff, ie maps made out of random arrangements of parts? I don’t exactly want to write up a bunch of code to consolidate a whole mountain of bricks into a union if it winds up being less performant than just said parts by themselves.

5 Likes

That’s fine, it’s extremely useful for effects as it is. Great job!

1 Like

Just out of curiosity, what is the advantage of this over the standard UnionOperation and IntersectOperation?

Does this allow deconstruction of the new meshes back into the original parts? I ask because I find that capability would be useful in explosion effects where unions and intersections are deconstructed into their component parts and sent flying for effect purposes. There is a feature request that I submitted some time ago requesting this exact feature for this exact use case.

If I’m reading and interpreting this correctly, this API allows the creations of new, coherent meshes similar to Unions and Intersection which are formatted differently (possibly irrevocably) internally for performance and storage efficiency reasons.

EDIT:

After doing some digging, it seems that this is the implementation of my feature request. Since there’s a split apart option, we get all the parts back. Furthermore, the parts in question do not have to be parented to the Workspace, which allows background processes to construct these meshes by script. This raises a couple of follow up questions though:

  • What is the API’s compatibility with Parallel LUA in performing operations on these constructs?
  • Can these methods be called from an unsynchronized thread?

In any case, I want to wait a little bit before this is finalized before I start playing with it.

2 Likes

This is awesome but, there is some issues with coding. Even though code is pretty much correct and no errors popping up, code still denying to work. I wish this coding problems will be fix soon as possible :slight_smile:

1 Like