sketchucation logo sketchucation
    • Login
    1. Home
    2. Greg
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    G
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 22
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Using add_3d_text

      Done.

      posted in Developers' Forum
      G
      Greg
    • Using add_3d_text

      Hello,

      I'm using the command add_3d_text to add text to objects. How do you
      change orientation of the text so that it looks like it's on the
      surface of a plane? For example, I'd like the text to display at the
      top and front of a rectangular cube.

      Here is a code snippet:


      top plane

      pt1 = Geom::Point3d.new(x,y,z+h)
      pt2 = Geom::Point3d.new(x+w,y,z+h)
      pt3 = Geom::Point3d.new(x+w,y+l,z+h)
      pt4 = Geom::Point3d.new(x,y+l,z+h)
      edges[0] = entities.add_line(pt1, pt2)
      edges[1] = entities.add_line(pt2, pt3)
      edges[2] = entities.add_line(pt3, pt4)
      edges[3] = entities.add_line(pt4, pt1)
      face = entities.add_face edges
      face.material = m

      t=Geom::Transformation.new(pt1)
      grp=entities.add_group(); grpEnts=grp.entities
      grpEnts.add_3d_text("hey mon", 1, "Arial", false, false, 4.inch,
      1.mm, 0, false, 0)
      grp.move!(t)

      front plane

      pt1 = Geom::Point3d.new(x,y,z)
      pt2 = Geom::Point3d.new(x+w,y,z)
      pt3 = Geom::Point3d.new(x+w,y,z+h)
      pt4 = Geom::Point3d.new(x,y,z+h)
      edges[0] = entities.add_line(pt1, pt2)
      edges[1] = entities.add_line(pt2, pt3)
      edges[2] = entities.add_line(pt3, pt4)
      edges[3] = entities.add_line(pt4, pt1)
      face = entities.add_face edges
      face.material = m

      t=Geom::Transformation.new(pt4)
      grp=entities.add_group(); grpEnts=grp.entities
      grpEnts.add_3d_text("hey mon", 1, "Arial", false, false, 4.inch,
      1.mm, 0, false, 0)
      grp.move!(t)


      Thank you.

      Greg

      posted in Developers' Forum
      G
      Greg
    • 1
    • 2
    • 2 / 2