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

    Topics

    • S

      Determine the origin of a component in world space

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      175 Views
      S
      @tig said: Every group or component-instance has a complex transformation giving 3d location, rotation, scaling and so on... You can use that insertion_point = instance.transformation.origin I had a feeling you'd be the one to answer TIG, and Thank you, thank you, thank you. Works perfectly. I spent hours pulling hair on this. Don't know why I didn't think of that.
    • S

      Calculating the final vertices of a nested face

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      3
      0 Votes
      3 Posts
      283 Views
      S
      @tig said: Have you tried tr=container.transformation.inverse and applying it to the initial object and then iterating and getting/setting the transformation for the container's container etc until you get to the model level... That didn't seem to work (inverse), though I may very well have misunderstood what you meant, but what you said gave me an answer anyway. By applying the transform to the points at each container successively, it works perfectly! (or at least in every test so far) Which is how I should have tried it initially but I was thinking from a performance standpoint, and forgot the old adage "premature optimization is the root of all evil" def WALK.GetParent(ent) Sketchup.active_model.start_operation("Walk") model = Sketchup.active_model @newg = model.entities.add_group m = model.materials.add "test" m.color="red" orig = ent tpos = Geom;;Point3d.new 0,0,0 # keep track of origin trans = Geom;;Transformation.new(Geom;;Point3d.new(0,0,0)) # add transforms to this vertices = orig.outer_loop.vertices.map {|v| v.position.clone} while (ent.respond_to?('parent') ) # walk up hierarchy if ((ent.is_a? Sketchup;;ComponentDefinition)) if ent.group? t = ent.instances[0].transformation # Get the group's transform vertices.each_with_index do |v,i| vertices[i].transform! t end end ent = ent.instances[0] # become the instance end ent = ent.parent end f = @newg.entities.add_face vertices # create the face f.material=m Sketchup.active_model.commit_operation end Thanks again for the help!
    • S

      [Plugin] VTF Normal Map Creator

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      4
      0 Votes
      4 Posts
      7k Views
      numbthumbN
      Thanks for this thorough explanation!
    • S

      Closing open groups via Ruby?

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      15
      0 Votes
      15 Posts
      1k Views
      tt_suT
      @dacastror said: @thomthom said: In SU2014, yes. What would be the best way to write this for Sketchup 8 or 2013? (google translator) In SU8 and SU2013 and older that method is bugged. No known workaround I'm afraid.
    • 1 / 1