How can I draw text in 3D within the draw method of a tool/overlay?
The View #draw_text method is used to draw text on the screen, but only accepts Point3d object representing a 2D coordinate in view space as parameter. This text is always shown on “top” of other objects and always horizontal relative to screen. I haven’t found any way to move, rotate, twist …(transform) it into 3D space.
So I would like to draw a text such a way as e.g. you add dimension where the dimension’s text is aligned to the dimension, so this text it is located in 3D space. Like this:
entities = Sketchup.active_model.entities
dim = entities.add_dimension_linear([0, 0, 0], [50, 0, 0], [0, 20, 0])
dim.has_aligned_text = true
Click to see animation
Of course, I don’t want to create (add) a Drawingelement to the model, “just” an overlay text in 3D space specified point.
It’s would be possible, I guess, because in Curic Scale++ he can do it somehow.
I’m talking about the texts that the green arrows point to:
I’m curious, @curic4su, how? Did you make your own library that draws the text by lines/points using the View #draw method, or is there other method I missed? Or perhaps, do you draw a temporary dimension that you then delete?
Does anyone else have any ideas?