sketchucation logo sketchucation
    • Login
    โ„น๏ธ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Calculate edge "profiles"?

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 755 Views 2 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.
    • A Offline
      Anton_S
      last edited by

      Being curious I decided try write my own method that would return edges that would be higlighted by SU "profiles" that are found in edge style settings. Here's screanshot of what I mean:
      ![Dark lines are edge "profiles"](/uploads/imported_attachments/7I2e_Untitled.png "Dark lines are edge "profiles"")
      I've tried to figure out how to get the profile edges myself, but don't plan to get my brain into enormous thinking tension; it's just hard and too complicated!!! ๐Ÿคข What I know is that to figure out what edges need to be highlighted there should be a known camera transformation (in this case only one point perspective cam) and current position of face edges (relative to real origin). By the way, If you know whats the real name for that edge "profiles" is called, please don't hide to tell, cause I've already searched the internet on "edge profiles", and got none of wanted. ๐Ÿ˜•

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        Here's a possible simplistic 'algorithm'...
        [Untested!]
        Find all of the available edges [in an array].
        Iterate through them and process each edge in turn.
        Get the vector from the edge.start.position to the model.active_view.camera.
        Get the edge.faces
        If there's not edge.faces[1] then the edge is 'in profile'.
        Otherwise process each of the edge.faces [assume there's two].
        Test the face.normal.angle_between(vector)>=90.degrees for both of them
        If one >90 then that face is not looking at the camera, therefore the edge is 'in profile'.
        If neither OR both are <90 then the edge is not 'in profile'.
        Do what it is you need to do to the edges that are profiles.
        You need some tricks to trap for edges partially obscured by other objects etc... that's stage 2 ๐Ÿ˜•
        Remember that if they are inside groups/instances then the points/vectors etc will need to be transformed to suit the container's transformation.....

        TIG

        1 Reply Last reply Reply Quote 0
        • A Offline
          Anton_S
          last edited by

          TIG, your profetional! โ˜€
          Everything works, the way you said ๐Ÿ˜„ ๐Ÿ˜ฎ ๐Ÿ˜ฒ
          [attachment=1:ylsl8vni]<!-- ia1 -->SelectEdgesInProfiles.png<!-- ia1 -->[/attachment:ylsl8vni]
          Here's a little plug I've got for a little testing.
          [attachment=0:ylsl8vni]<!-- ia0 -->SelectEdgesInProfiles.rb<!-- ia0 -->[/attachment:ylsl8vni]
          %(#00BF00)[Select Edges in Profiles
          Date - Monday, July 16, 2012
          Version 1.0.1
          Main thing on how to locate the edges in profiles is by TIG
          Written by Anton Synytsia
          Not a plugin, but written for simple use of testing

          Menu Location: UI_menu:plugins/selectEdgesInProfiles

          Usage: Select grp(s) or/and component instance(s) and then select the menu item

          Yet, Unsolved bugs:

          • Selects edges that camera doesn't sees.
          • TIG.getEdges function doesn't yet search the group for edges found inside the parent group.]

          Changes: Fixed the selection of edges behind the faces, the edges that camera doesn't even sees.


          Save to Plugins directory

          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