What is the unit of measure of 'instancedmesh#edgeswidth'?

Hi,

I am currently in the process of drawing my own BoundingBox that would have some width. I saw InstancedMesh#edgesWidth.

What I am wondering is what is this number. Is it the width of the line based on the other objects on the scene? If I have a box that is 10, 10, 10 with edgesWidth of 1 this means we would have the line take about 10% of each side?

Does anyone know what the unit of measure of edgesWidth is?
Thanks.

It is in pixels with this formula:

line width = mesh.edgesWidth / edgeRenderer.edgesWidthScalerForOrthographic

1 Like

This means that “smaller” models will have thicker edges lines. I have some very large models where edgeWidth=1 is ok but edgesWidth=1 is way thicker some of the smaller once.

I found it here:

/**
 * This class is used to generate edges of the mesh that could then easily be rendered in a scene.
 */
export class EdgesRenderer implements IEdgesRenderer {

    /**
     * Define the size of the edges with an orthographic camera
     */
    public edgesWidthScalerForOrthographic = 1000.0;

    /**
     * Define the size of the edges with a perspective camera
     */
    public edgesWidthScalerForPerspective = 50.0;

I could theoretically modify the edgesWithScalerForPerspective based on the size of the model. The property is public. But I can not see how to modify it. The _edgesRender is private for each mesh.
I have searched the whole repo - Search · edgesWidthScalerForPerspective · GitHub but the value of 50.0 seems not to be configurable. Is this stric? Could it be exposed in a way to make edgesWidth=1 for smaller models look thinner?

mesh.edgesRenderer should work :slight_smile:

You are actually quite right. Guess I was expecting getEdgesRenderer() like scene.getBoundingBoxRenderer().

1 Like