Is the discbuilder by design inaccurate on low tesselation or am I misusing it?

Hi,

I want to create a half-circle, that I am going to use for RayCasting if one object can “see” another object. I looked at the various options and came to the conclusion that the disc builder was the best match for creating a circle like mesh. However I wanted to use a tesselation of 16 and arc of 0.5. The produced the following result, which is not nearly a half circle.
https://www.babylonjs-playground.com/#DJF437#113

Using the default tesselation of 64 actually produces a good result.

Using the cyllinder builder gives a much better result on lower tesselation, but it does not actually produce a circle (height zero seems to default to something else).
https://www.babylonjs-playground.com/#CWPN2T#394

Am I misunderstanding the parameters for the disc builder, or its general use? Does anyone have a suggestion for a better way to represent a circle, without actually implementing it myself?

Thanks!

Indeed, the function can be improved I think:

https://www.babylonjs-playground.com/#DJF437#114

I will do a PR.

1 Like

@tajen
I agree this seems odd.

What do you mean?

For eg:

Tessellation is 8 and there are 8 vertices.

The tessellation value is the number of vertices created, not the number of triangles (at least when arc != 1 - when arc is 1 it is both the number of vertices and triangles created as we close the circle with an additional triangle).

[EDIT] Ah, you removed your post, so my answer is a bit off! [/EDIT]

1 Like

Nevermind me :slightly_smiling_face:
Clearly too tired to even think atm, forgot to account for the “missing” area “adding” a side to the mesh.

1 Like

Thanks for the speedy update. I am not familiar with the BabylonJS update cycles, how long does it usually take from a PR is completed until its shipped in a new release? :slight_smile:

tomorrow? :slight_smile:

1 Like

Even before: it is now live (on the preview CDN / on the Playground).