sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Construction line idiosyncrasy

    Scheduled Pinned Locked Moved Developers' Forum
    1 Posts 1 Posters 187 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      Roschetch
      last edited by

      According to the SU API, a ConstructionLine object has the following geometrical properties:
      direction, position, start and end.
      The start and end of infinite ConstructionLine objects are nil. Semi-infinite ConstructionLine objects have either a non nil end or a non nil start. Finite ConstructionLine objects have non nil start and end.

      These 4 properties are not independent and some odd results may surprise us.

      ent = Sketchup.active_model.entities
      #<Sketchup;;Entities;0xa02542c>
      p = Geom;;Point3d.new(0,0,0)
      Point3d(0, 0, 0)
      dir = Geom;;Vector3d.new(1,1,0)
      Vector3d(1, 1, 0)
      ent.add_cline(p,dir)
      #<Sketchup;;ConstructionLine;0xa024f90>
      cl = ent.add_cline(p,dir)
      #<Sketchup;;ConstructionLine;0xa024e64>
      cl.end = Geom;;Point3d.new(100,100,0)
      Point3d(100, 100, 0)
      cl.start = Geom;;Point3d.new(0,0,0)
      Point3d(0, 0, 0)
      cl.end = Geom;;Point3d.new(200,0,0)
      Point3d(200, 0, 0)
      cl.end
      Point3d(100, 100, 0)
      cl.end = Geom;;Point3d.new(300,0,0)
      Point3d(300, 0, 0)
      cl.end
      Point3d(150, 150, 0)
      

      It seems to me that the end method projects the input Point3d in the line before setting it. The same behaviour is observed for the start method.

      If the input point of either the end method or the start method is not in the line of the construction line, we should change the line direction too.

      cl.direction = Geom;;Vector3d.new(1,0,0)
      Vector3d(1, 0, 0)
      cl.end = Geom;;Point3d.new(300,0,0)
      Point3d(300, 0, 0)
      cl.end
      Point3d(300, 0, 0)
      
      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Buy SketchPlus
      Buy SUbD
      Buy WrapR
      Buy eBook
      Buy Modelur
      Buy Vertex Tools
      Buy SketchCuisine
      Buy FormFonts

      Advertisement