HI,
Has any one any pointers on how to create a domed end to an extruded geometry. I have included a short video showing the effect on a Box geometry, but I need the box to be an extruded geometry.
Many Thanks
HI,
Has any one any pointers on how to create a domed end to an extruded geometry. I have included a short video showing the effect on a Box geometry, but I need the box to be an extruded geometry.
Many Thanks
Maybe not good solution. Determinate vertices which needs to pull.
let vertice=mesh.geometry.attributes.positions.array;
let max=mesh.geometry.attributes.positions.array.length;
let center={x:0;y:0,z:0};
for(let n=0;n<max;n+=3){
let y=vertice[n+1]
if(vertice[n+1]>0){
if(center.y==0){ center.y=vertice[n+1]+0.2; }
let distance=Math.sqrt((center.x-vertice[n+0])**2+(center.y-vertice[n+1])**2+(center.z-vertice[n+2])**2);
vertice[n+1]+=distance/10;
}
}
mesh.geometry.attributes.positions.needsUpdate=true;
Hi @Picklehead …
I would do like this…
Thanks for the suggestion
Thanks for the link, do you know if the SVG part is taken out of the equation will this work with just THREE.ExtrudeGeometry ?
I tried but ended up with two separate meshes, not sure if this is correct as not used CSG before
I will send a second example in which I then join the two parts… with CONTROL+U You can get the entire code
In the code sent previously, there is an intersection of the sphere and the extrusion… so I left the extrusion visible, that is, there are two meshes left.
In the new example I join the result of the intersection with the extrusion mesh to create a single final mesh.
You will see both results now… one with 2 meshes and one colored is only one mesh.
The CSG result is only one mesh… then You can add the result with other meshes…
PS: You can see that the meshc is similar to meshb, but in another position, prepared to be united with the result.
The next link:
And I decided to make one page more showing the three options of CSG…
@jrlazz that is brilliant, as I mentioned not used CSG before so very much appreciate the help!!