MDP Monkey Posted December 13, 2017 Share Posted December 13, 2017 Hi guys, I wonder if someone can supply a full working demo of a basic arc2? It's in the API docs, but it's not clear how to use it. I've tried using a lathe, but I can't get it to work. I'm using a quadraticBezier at the moment, and it doesn't quite give me the curve I want. Arc2 seems to be what I need, but as I said there are no code samples or playground examples for me to see the correct use/syntax. Just a really basic example would be enough for me to start playing with it. Thanks! Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 14, 2017 Share Posted December 14, 2017 Hi MDPM, how ya doon? I hope well. Sorry for the slow replies. You are correct... there's not many demos, and the PG search is being grumpy when trying to search for ""Math.Arc"", too. I'm going to ping @jerome and see if he can help us do a linesMesh plot of some Arc2's, perhaps using the only PG I could find... a barely-started... https://www.babylonjs-playground.com/#6G0UJL#0 Jerome is a wizard of plotting-with-math... and a darned nice guy, too. Hopefully, he (or someone else) can rescue us. Stay tuned and try to be patient. thx. Quote Link to comment Share on other sites More sharing options...
jerome Posted December 14, 2017 Share Posted December 14, 2017 no idea about what is this Arc2... any doc anywhere ? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 14, 2017 Share Posted December 14, 2017 Hi J, thx for the visit. I only see the source and the classDoc file. Sorry. Quote Link to comment Share on other sites More sharing options...
JohnK Posted December 14, 2017 Share Posted December 14, 2017 Arc2 is used within Path2.addArcTo. Path2 is a way of producing a 2D shape given x and y coordinates. The path can then be used by PolygonMeshBuilder to draw a polygon based on the path (confusingly in the xz plane) Path2.addArcTo takes 5 parameters so Path2. addArcTo(midX, midY, endX, endY, numberOfSegments), startX and startY being the previous points in Path2. You cannot start a path with an arc. Path2 documentation This PG builds and extrudes two polygons, the top one by giving the corner points of the polygon and th lower one by creating a path2 object. You can see the use of addArcTo in the lower polygon and the curve it produces. https://www.babylonjs-playground.com/#PTTMVI#1 Wingnut and jerome 2 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.