Note: For now, assume y is 0, as offsets ect. can be made later.

My goal is to make an generator which makes a 2d “block” circle.

Currently, It’s not working so well.

My end goal is a equation which can make a circle like this (with varried radius)

Currently, I have this:

local r = 20
for x=-r,r,unitSize do
local n = math.floor((math.sqrt(-(x^2) + (r^2)))/unitSize)*unitSize
placeObj(Vector3.new(x,20,n))
placeObj(Vector3.new(x,20,-n))
end

local radius = 20
local number_of_parts = 20
local circle = math.pi * 2
for i=1, number_of_parts do
local angle = circle / number_of_parts * i
local x_pos = math.cos(angle) * radius
local y_pos = math.sin(angle) * radius
local part = Instance.new('Part', workspace)
part.Size = Vector3.new(1,1,1)
part.Anchored = true
part.Position = Vector3.new(x_pos, 0, y_pos)
end

You may want to round the position to the grid from what I see.

Or if you have the “nodes” already, you can just check magnitude from center to each node.

Is it possible to implement CFrame:ToObjectSpace() to position in ratio to the “grid” present? Or would it be too complicated? I can’t figure out a way to implement this.

Dividing and math.floor works for me most of the times
Depending on what you want to make, you’d need different approaches.

I’m not exactly sure what do you want to achieve with ToObjectSpace, but in the end, you’d have to go back to diving and math.floor from what I can think of.

I just thought it would be easier to position the parts using CFrames in relation to the grids CFrame (kind of like an index). But the solution you proposed above works too.