How to draw ruler?

I want to draw a ruler by panda3D, but I don’t know how to implement, I don’t know what object can do it LineSegs or Others? , please give me some ideas

the ruler like the attachment

thanks

I take it that you want a procedurally-generated ruler, and so don’t want to just load a model of a ruler? If so, you might have success using Meshdrawer (or, if you want a 2D ruler, Meshdrawer2D).

API references: Meshdrawer; Meshdrawer2D

can you give me simple for Meshdrawer or Meshdrawer2D?

I take it that you mean a sample? The manual page that I linked to above has part of a small sample, I believe. Have you tried building something based on that?

To some degree, I think that how Meshdrawer is used depends on what you want it to do. For example, if you want the generated geometry to be updated every frame then you might want a task, as shown on the manual page; on the other hand, if you want to generate the geometry once and leave it largely unchanged then you might want to manually call the method that you create to “draw” you Meshdrawer geometry, and then simply move, scale, rotate, etc. the Meshdrawer NodePath as you would any other.