How to make part that fills in points

  1. What do you want to achieve?
    I am trying to get a polygon to form in the middle of points
  2. What is the issue?
    image
    image
    I have no Idea how to approach this. I have looked at other solutions but I cant understand them :expressionless:
    Thanks for any help!

Use gap fill by stravant it’s an easy solution

1 Like

It needs to be done in a live server on the fly

Well you can look into live CSG to make a cutout shape that fills the hole.

I was thinking about CSG but How would I cut it out, Its for making roofs on buildings

Use Gap fill the plugin, it fills in gaps like it says in the title, and it would work how you would like it.

1 Like

But this has to work in a live server on the fly

Hmm, like with a script? Or something else?

If it is with a script, it would be pretty hard…

Most of the time you can’t make those shapes without unions or meshes.

However, you could just change the transparency of the parts, and just have the parts already there and ready.

You see, Im using a system with OSM mapping data, I am working on roof buildings. So I couldnt plan ahead of time.

Yeah, good luck, lol, that is above my expertise.

Thanks for the help! :smiley: :+1:t2: :+1:t2:

CSG can be done at runtime now, if I’m not mistaken.

You’d cut a hole in a part by using a cylinder, CFraming it inside the part you want to cut a hole in at the position and orientation the hole is supposed to be, Negating the cylinder, then unioning the part and the negated cylinder.

Hope this helps.

I’m not looking to put a hole in the roof, I’m trying to create a roof! but thanks for the help!

Uh, you could create a roof by starting off with a block and then cutting off chunks of it using Negated parts until it resembles a roof.

If you have a brick and you want it to resemble a triangle, what do you do to the brick?

So the part is in the Blue and we negate with the red?
image

This is how it works:

Mind you, your Negated part doesn’t have to be a circle. You can Negate literally any geometry.

Just for a non-CSG solution, can the polygon be concave? Does it have an arbitrary number of points?

I think a non-CSG solution is the best here, yes the polygon can be concave and It does not have a arbitrary amount of points as it is simulating real life buildings.

There might be a module out there for this, but you’re looking for polygon triangulation. That wiki page has a few methods listed, you could pick one.

Or, simplify the problem, so you don’t have to :slight_smile:

edit: here is an implementation of the ear clipping method (O(n^2)) in lua 5.1