• Login
sketchucation logo sketchucation
  • Login
🔌 Quick Selection | Try Didier Bur's reworked classic extension that supercharges selections in SketchUp Download

Edge.split Point3d not working as expected?

Scheduled Pinned Locked Moved Developers' Forum
4 Posts 3 Posters 261 Views 3 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.
  • C Offline
    Chris Fullmer
    last edited by 16 May 2009, 23:07

    Hi, this is the code I'm testing

    edge = Sketchup.active_model.entities.add_line([0,10,0],[100,10,0])
    pt = Geom::Point3d.new ([80,200,100])
    result = edge.split pt

    I was under the impression that if the supplied Point3d was not on the edge, then the edge would not be split and it would return an error. But no matter I put in for the Point3d in this example, it always breaks the line. Well, thats not true, as long as the x value is less than 100. Anyhow, is this method slightly broken?

    Chris

    Lately you've been tan, suspicious for the winter.
    All my Plugins I've written

    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 17 May 2009, 17:50

      Look at my "AddVertex+.rb" that let's you add cpoints and split edges faces etc in a number of ways depending on which modification-keys you hold down as you pick the point. It checks whether you are picking on an edge, face etc...

      TIG

      1 Reply Last reply Reply Quote 0
      • C Offline
        Chris Fullmer
        last edited by 18 May 2009, 06:18

        Well its not that I can't get it to work, its that I think it is flawed, or else I'm misunderstanding how the method is supposed to work.

        The API says that you can give .split accepts a Point3d onject or a float. If its a float, zero through 1, then it uses that to splut the edge using the float as a sort of percentage. That works great.

        It says that if you supply a Point3d object, it MUST be on the edge.

        But the example I showed, the point3d object is not on the edge at all, but it still split the edge. So it seems like it should return an error or false or something. But its not, it splitting the edge. Which is wrong.

        Or am I just misunderstanding the method?

        Chris

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

        1 Reply Last reply Reply Quote 0
        • T Offline
          thomthom
          last edited by 18 May 2009, 06:22

          It does sound like it should fail if it's not on the edge. I would have expected a nil return like many of the other functions when they fail.

          Thomas Thomassen — SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          1 / 1
          • First post
            3/4
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement