Accessing text dots in 3dmloader js

Hi @dale @fraguada,

Are the text dots in the rhino3dm loader css2dobjects or just meshes ?

If they are meshes then I should be able to get the properties (like displaytext and layer) of the textdots by raycasting to them. Am I correct?

yes, though they should have their attributes under their userData object. In the 3dmLoader example I read that property to put the textdots into their layer.

After the 3dmLoader has loaded a 3dm file, the resulting object has a layers property object.userData.layers. Each child object has a layerIndex child.userData.attributes.layerIndex

So, I should be able to change the way the textdots look by using css styles. But for that I think it is necessary to know what css class they belong to.

Am I correct @fraguada @dale ? How do I find that?

Not really, I think I am only grabbing the draw color, font height, and font face (the name of the font). All of these you set in Rhino. It isn’t a great solution at the moment (due to certain constraints), so if you have any suggestions, we’re all ears!

I somehow do not like how the text dots look in rhino3dmjs. Attached is a screenshot of what I’d like the text dots to look like. This is a gltfloader with css2dobject whose appearance is manipulated using CSS.

So is there a way I can set the draw color, font height and face of all the text dots using rhino3dmjs?

I think you could go though the text dot objects once the 3dm data is loaded and change those properties.

Oh okay. Will try this @fraguada. Thank you :slight_smile:

Hi @fraguada,

I just checked the example file in the three.js website. It says the text dots are converted to sprites in three.js. So I’m guessing the only way is to hide the sprites and read the data off them and create new css2dobjects.

1 Like