jerome Posted June 2, 2015 Share Posted June 2, 2015 Hi people, Here's a new mesh type that I would like to propose : Lathe. Lathe is a simple mesh type which combines cylinder and extrusion properties in an easy way to build more complex meshes. Let's define a shape to be "lathed", the model, in the xOy plane, considering that the world Y axis will be the lathe rotation axis then : http://www.babylonjs-playground.com/#1KN1LB Now let's create the Lathe from this model : http://www.babylonjs-playground.com/#1KN1LB#1Lathe will have two parameters in addition to the model shape :a radius : http://www.babylonjs-playground.com/#1KN1LB#2a tessellation : http://www.babylonjs-playground.com/#1KN1LB#3 which both will have default values So this will be something as simple as :var lathe = BABYLON.Mesh.CreateLathe("lathe", shape, radius, tessellation, scene);Want it ?(only 20 LOC) Blax, Vousk-prod., Wingnut and 1 other 4 Quote Link to comment Share on other sites More sharing options...
jerome Posted June 2, 2015 Author Share Posted June 2, 2015 When talking about "more complex meshes"... well, just set a more complex model : http://www.babylonjs-playground.com/#1KN1LB#4lathe : http://www.babylonjs-playground.com/#1KN1LB#5 What about caps ?you could them by yourselves with the adequate shape : http://www.babylonjs-playground.com/#1KN1LB#6lathe : http://www.babylonjs-playground.com/#1KN1LB#7 Quote Link to comment Share on other sites More sharing options...
jerome Posted June 2, 2015 Author Share Posted June 2, 2015 no comments ? too late : PRed ! Temechon and iiceman 2 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted June 2, 2015 Share Posted June 2, 2015 I LOVE IT!!! Congrats! You're a mad man, Jerome! Excellent! Remember the... "PR every 45 minutes" ...prediction for you, that I made before? jerome 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 2, 2015 Share Posted June 2, 2015 And this may be the last PR of 2.1 Quote Link to comment Share on other sites More sharing options...
jerome Posted June 2, 2015 Author Share Posted June 2, 2015 just in time Quote Link to comment Share on other sites More sharing options...
JohnK Posted June 2, 2015 Share Posted June 2, 2015 As usual you said you would do it and so you did. Will enjoy trying it out. Quote Link to comment Share on other sites More sharing options...
adam Posted August 4, 2015 Share Posted August 4, 2015 This looks awesome Jerome. I'm planning on using the lathe in my current project, but there seems to be an issue with it. You can see some shading issues and artifacts in the capped version:http://www.babylonjs...d.com/#1KN1LB#7 I lowered the tesselation so that you can better see the geometry:http://www.babylonjs-playground.com/#1KN1LB#8 Here I use the BABYLON.Mesh.createLathe function:http://www.babylonjs-playground.com/#1KN1LB#9 Here I reduced the shape to a simple line:http://www.babylonjs-playground.com/#1KN1LB#10 Quote Link to comment Share on other sites More sharing options...
jerome Posted August 7, 2015 Author Share Posted August 7, 2015 ok, I'll check this when I'm back Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 7, 2015 Share Posted August 7, 2015 We miss you:) Quote Link to comment Share on other sites More sharing options...
jerome Posted August 7, 2015 Author Share Posted August 7, 2015 It's an art to make oneself desired Quote Link to comment Share on other sites More sharing options...
adam Posted September 3, 2015 Share Posted September 3, 2015 How often does the newest version of BJS get pushed to the playground? I'm hoping Jerome's latest commit to Path3D will fix the issue with the lathe. Quote Link to comment Share on other sites More sharing options...
jerome Posted September 4, 2015 Author Share Posted September 4, 2015 I'm on the cylinder/tube normal computations for nowstep after step don't worry extrusion and lathe will be checked too Quote Link to comment Share on other sites More sharing options...
jerome Posted September 4, 2015 Author Share Posted September 4, 2015 I don't know when the latest BJS version is pushed.It's a manual operation done by DK or Davrous quite frequently Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 4, 2015 Share Posted September 4, 2015 It was updated yesterday (beware though: intelissense was not updated) Quote Link to comment Share on other sites More sharing options...
jerome Posted September 4, 2015 Author Share Posted September 4, 2015 yepbut I'm afraid the path3D fix won't fix anything about the lathe caps, it's another topic imho Quote Link to comment Share on other sites More sharing options...
adam Posted September 29, 2015 Share Posted September 29, 2015 I was able to improve the lathe by adding some code to Mesh._ExtrudeShapeGeneric. I check to see if the first element in Path3D is the same as the last element. If it is, I don't modify the shape using the tangents, normals, binormals. without fix:http://www.babylonjs-playground.com/#1KN1LB#9 with fix:http://www.babylonjs-playground.com/#1KN1LB#18 without fix:http://www.babylonjs-playground.com/#1KN1LB#10 with fix:http://www.babylonjs-playground.com/#1KN1LB#21 I'm not sure how good of a fix this is. Hopefully it is something you can use. jerome 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted September 30, 2015 Author Share Posted September 30, 2015 really nice Quote Link to comment Share on other sites More sharing options...
adam Posted September 30, 2015 Share Posted September 30, 2015 I found that I can reduce the shading issues on the end caps by setting the lathe radius to .001 and the smallest x on the end caps to .001 instead of 0. http://www.babylonjs-playground.com/#1KN1LB#26 jerome 1 Quote Link to comment Share on other sites More sharing options...
adam Posted October 1, 2015 Share Posted October 1, 2015 I got the caps looking pretty good. http://www.babylonjs-playground.com/#1KN1LB#32 jerome 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted October 2, 2015 Author Share Posted October 2, 2015 Nice hack Adam !It seems you found a way to do it right I'll check all you've done once I finish all the underground stuff on Mesh.CreateXXX() methods. Quote Link to comment Share on other sites More sharing options...
jerome Posted October 4, 2015 Author Share Posted October 4, 2015 I guess I need to implement the same smooth seam on the closeArray ribbon mesh parameter than the closePath one and everything should then work directly Quote Link to comment Share on other sites More sharing options...
jerome Posted October 7, 2015 Author Share Posted October 7, 2015 well : http://www.babylonjs-playground.com/#1KN1LB#33 Normally, if we want no artifact on the caps, we should duplicate second and the n-1 vertices (if capped on bottom and on top) in the shape array.As we can see the light reflection is (almost) correct. It remains an artifact which is related to the (wrong) geometry of the lathe. I guess this happen on the way the lathe is closed, I need to check Quote Link to comment Share on other sites More sharing options...
adam Posted November 12, 2015 Share Posted November 12, 2015 The tessellation parameter seems to be broken on the createLathe function. Quote Link to comment Share on other sites More sharing options...
jerome Posted November 12, 2015 Author Share Posted November 12, 2015 it seems the backport from the MeshBuilder to Mesh class had some bad effects... we need to check this.Try the MeshBuilder call : http://www.babylonjs-playground.com/#1KN1LB#35 grrr.. I don't get why these artifacts are back, they weren't ... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.