Generating Block Circles

I have a function that puts a block at (x,y,z)

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)image

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

Thank you for your time.


Trigonometry approach:

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 ='Part', workspace)
	part.Size =,1,1)
	part.Anchored = true
	part.Position =, 0, y_pos)

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.

I know I can make a circle, the problem I’m having is making it work in a grid fashion

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’ve tried using math.floor like this:


It seems to act weirdly, though

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.

Better add an extra bracket with that. What was “weird” about it?

Thanks for the help, I used


to fix it in relation to the grid

You could also just use this:

This page might be helpful for those who want some more intuition behind it:

1 Like