sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Invert inverted axes in symetrical components

    Scheduled Pinned Locked Moved Extensions & Applications Discussions
    extensions
    1 Posts 1 Posters 811 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.
    • IltisI Offline
      Iltis
      last edited by

      Hello,

      If the making process of a component is a duplication by symetrical operation, then "make unique", the axis are inverted.
      (Sorry for this bad english! 😞 )

      This is a problem for me for a plugin containing arcs exportation.

      Do you know how to test the orientation of the axis and how to change it temporarely in my calculations if it's not direct (red, green, blue)?

      I think it must be here in my code :

      # Recursively export faces and exploding groups and components
      def self.write_content(file, selection, tform, z)  # if z==1, it's a 3D export file, if z==0, it's a 2D export file (all the Z values are equal to "0.0" and the normal.z is equal to "1.0"
         selection.each do |entity|    
            if entity.is_a?(Sketchup;;Face)
            transform_vector_of_group(entity.normal, tform)
               if z == 1 || (z == 0 && transform_vector_of_group(entity.normal, tform).parallel?(Z_AXIS) && transform_point_of_group(entity.vertices[0].position, tform).z.abs < 0.001 ) # Sketchup tolerance ; 0.0001 inch
                  $number_of_exported_faces +=1
                  write_face(file, entity, tform, z)
                  result = Sketchup.set_status_text $number_of_exported_faces.to_s, SB_VCB_VALUE
               end
            elsif entity.is_a?(Sketchup;;Group) || entity.is_a?(Sketchup;;ComponentInstance)
               if entity.is_a?(Sketchup;;Group)
                  definition = entity.entities.parent
               else
                  definition = entity.definition
               end
               write_content(file, definition.entities, tform * entity.transformation, z)
            end
         end
      end
      

      Thank you very much.
      Renaud.

      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