Hi,
Is it possible to combine or merge a lathe with 2 boxes similar to the attached image?
Any pointers, help or info greatly appreciated.
Thanks
Hi,
Is it possible to combine or merge a lathe with 2 boxes similar to the attached image?
Any pointers, help or info greatly appreciated.
Thanks
With CSG or without CSG?
You can use BufferGeometryUtils.mergeBufferGeometries() for merging multiple geometries in a single instance. Normally, you want to transform the geometries before doing that so for example your cubes end up at the top and bottom. This can be achieved by directly transforming the geometries you want to merge via methods like translate()
or rotateY()
. The minecraft demo is a good code template for this.
Hi, without CSG.
HI, thanks for the information and will read up on this!
I have not used BufferGeometryUtils.mergeBufferGeometries yet, would you know what the expected outcome would be where the lathe intersects the cube?
Would the two merge as the image producing the slightly domed effect on the cube?
Thanks again!
Nope, but you can shape it
There are one lathe geometry and two box geometries, merged into a single one.
Example: https://codepen.io/prisoner849/pen/rNrqxBG
PS It’s not the ultimate solution, it’s just an example. I would go with a custom geometry for end elements.
The curved lower or upper side of the cuboid certainly corresponds to a piece of a spherical surface. If you then want to fit a cylinder or lathe exactly, you need the section curve.
Something like that I did there:
Triangulation sphere with holes
Inner Geometry (Triangulation)
However, this is a bit more complex.
Thank you, that example was a great help!
Thank you, that’s great!
Looks like a combination of both examples will give the required result need!
I’m helping out a friend who requires the ability to design staircases online in 3d and the lathed posts are one of the final pieces that need coding.
Thanks to everyone for the help!!
In this case I recommend a custom geometry, as already suggested by @prisoner849.
This is also not so difficult if you are not exactly a beginner.
or see e.g. function buildArchaway( i ) {
Line 502 in SHOWROOM/showroomBuildt.js at 3b3e76f9c059dbf328dfe901a92454d06bedf166 · hofk/SHOWROOM · GitHub
from
Showrooms easy to generate from data of a construction drawing or dimensional sketch - now on Github
Good success!
Thank you again!
Only 3 months working with three.js and still learning, so fingers crossed