 # Mesh Difference & Circle Location

Hi, I am new to gh and Rhino and trying to build a structure with tubes inside, maybe like a lotus root. There are two problems I want to consult:

(1) Mesh difference

I have built some tubes as lofts and then a cylinder around the lofts. I turn the cylinder and the lofts into meshes and want to subtract the lofts from the cylinder with ‘Mesh Difference’ but it gives the result above. I wonder if I should actually turn the lofts’ centres into holes before turning them into meshes.

What functions should I use to achieve this?

(2) Circle location

I want to set the base circle of the cylinder to be around the populate 2D points. I draw the circle based on the same rectangle for populate 2D, but the location is different from that of the rectangle.

How can I set the circle right without drawing the circle on rhino?

tube_cave_cir_clean_20210506.gh (16.4 KB)

This is the gh file I have. Any help / suggestions appreciated. Thank you!

Chun

Is there any specific reason why want to use meshes?
Doing this with breps (polysurfaces) and solid difference is way easier.

If you still need a mesh, you can use the QRemesh (Quad Remesh) component from Rhino 7.

tube_cave_cir_clean_20210506b.gh (16.6 KB)

3 Likes

Thank you so much, diff-arch! This is exactly what I want! And the gh file is so nicely organised . . .!

I used mesh just because I am still unsure about the differences between mesh and brep even after some search. The math part of calculating the location is definitely the hardest part for me It calculates the diagonal of the rectangle from its width x and height y. The width and height can be viewed as opposed and adjacent sides of a right triangle. In this scenario, the hypotenuse h is the third side and diagonal of the rectangle. The formula I use is called Pythagorean theorem and goes as follows: h^2 = x^2 + y^2

The diagonal can then be halved and used as the circle radius. You thus get a circle that - when drawn from the center of the rectangle -, is enclosing the rectangle and thus the random points that you generated inside of it.

crystal clear, thank you 