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

    Posts

    Recent Best Controversial
    • [PlugIn] 3D Printers G-Code importer/Exporter Ver0.0.9

      Hello Guys.
      Small step in Plugin Vertion giant leap for 3D-Printer's kind

      Attached is a 3D-Printer's G-Code Importer AND Exporter.
      It will turn Sketchup to a Virtual 3D-Printer 😍
      Plugin

      Version 0.0.9
      New in Importer:
      Will put a Attribute with the value of speed from the imported G-Code in the
      "filament" & "MotorMove" components
      Change the Z scale of the "filament" component according to the amount of
      extruded filament in the imported G-Code
      New in Exporter:
      Export to the G-Code the Attribute of speed as was imported by the importer.
      Export the Extruded length according to the Z scale of the "filament" component

      Version 0.0.8
      Added to the exporter the ability to connect "unconnected" components
      so now if a component is deleted - the exporter will just put a link to the
      first component of the disconnected chain

      Version 0.0.7
      Now we have a G-Code Exporter of the previously imported G-Code in the plugin menu.
      So I changed the name to GcodeTools ... (please delete the old one)
      The new exporter is a very simple assuming that in the next versions will be
      adding all the needed features to make it usable
      [highlight=#ffff40:34kfw3wr]- so please let me know what need's to be fixed!.[/highlight:34kfw3wr]

      Version 0.0.6
      Added Layers - Each New Z level gets it's one layer
      - Using the Sketchup Layer it is easy to hide and unhide Layers of the Gcode
      Version 0.0.5
      Impruvment to speed by making no shadow hidden edjes of the filament

      If you just want to help clean up my begginesrs ruby codeing
      you can use this test gcode files Test files

      I would like to thenk the guys who helped me allot in the
      Developers' Forum at http://sketchucation.com/forums/viewforum.php?f=180
      Thank you.

      P.S

      1. Look at the ruby console to see the progress of the importing - every 1000 lines it prints the line count
      2. In the "Entity Info" you can see the line of G Code that is responsiable for the filament pice
      3. A move of the motors is also a component with a line inside - so you could hide it by hiding the line inside one of the movements.

      My Motivation for writing this Importer:
      I am trying to learn about 3D printing while waiting for my printer to arrive.
      I was using SketchUp to play with 3D design for many years, so it was natural for me to
      make a 3D model with SketchUp - slice it - and see the result.

      I made few models, downloaded few from the internet - that was no problem.
      Slicing turned out to be much harder.
      I tried 3 slicing softwares with different levels of success.
      In the process foud out that there are two types of G-Code formats,
      and that it is not possible to convert from one type of G-Code to the other.

      So I started to write an importer of G-Code for Sketchup.
      My intention is that it will be possible to see what the G-Code will look like in a "neutral" environment and will enable the export of G-Code in a "wanted" format

      Please follow my work and give any advice you think fit.
      Keep in mind it is a work in progress...

      Thank you,
      David.


      The Plugin


      Plugin


      The Plugin


      Plugin


      Plugin

      posted in Plugins
      D
      Davidfi1
    • RE: Help with transformation

      Thank you.
      I will post the G-Code importer I am workin on soon
      Then you could play with it and see if it is possible to make the original code more elegant.
      The code I posted works!. It is a little ... well ... not very elegant - but it works πŸ˜„

      posted in Developers' Forum
      D
      Davidfi1
    • RE: Help with transformation

      Well, In the documentation it says that if the second parameter is a vector
      It will be used as a Z axis - this is what is happenening!.

      Quote:
      Geom::Transformation.new(origin, zaxis) creates a Transformation where origin is the new origin, and zaxis is the z axis. The x and y axes are determined using an arbitrary axis rule.

      posted in Developers' Forum
      D
      Davidfi1
    • RE: Help with transformation

      hhh - doesnt work πŸ˜„
      All our work for nothing

      posted in Developers' Forum
      D
      Davidfi1
    • RE: Help with transformation

      Do I need to do the checking ORIGIN etc..?
      Or it should be:

      
      def add_Filament( startPoint, endPoint , filament )
         @lineVector = startPoint.vector_to endPoint
         return if @lineVector.length.to_f - 1e-6 < 0.0
      
         # Scaling and adding an instance of the filament
         @scale      = @lineVector.length.to_f / filament.bounds.height   #width #depth
         @trans      = Geom;;Transformation.scaling 1, @scale, 1
         @instance   = Sketchup.active_model.active_entities.add_instance( filament, @trans )
      
         # Moving And Rotating the filament to the @lineVector
         @trans    = Geom;;Transformation.new startPoint, @lineVector
         @instance.transform!( @trans )
      end # def add filament
      
      

      P.S - Why filament.bounds.height is the length of the Y axis of the component?
      I thought height is the Z axis - no?

      posted in Developers' Forum
      D
      Davidfi1
    • RE: Help with transformation

      OK - I finished πŸ˜„ I think.
      This is what came out:

      def add_Filament( startPoint, endPoint , filament )
            @lineVector = startPoint.vector_to endPoint
            return if @lineVector.length.to_f - 1e-6 < 0.0 
      
            # Scaling and adding an instance of the filament
            @scale      = @lineVector.length.to_f / filament.bounds.height   #width #depth 
            @trans      = Geom;;Transformation.scaling 1, @scale, 1
            @instance   = Sketchup.active_model.active_entities.add_instance( filament, @trans )
      
            # if needed rotate the filament
            @lineVector.normalize!
            @instYaxis  = Geom;;Vector3d.new( 0, filament.bounds.height, 0 ).normalize #height givs the Y axis
            @rotDeg     = @instYaxis.dot( @lineVector )
            @rotDeg     = Math;;acos( @rotDeg )
            if @rotDeg.to_f - 1e-6 > 0.0
              if @rotDeg.to_f + 1e-6 > Math;;PI 
                @rotVector = Geom;;Vector3d.new( 0, 0, 1 )
              else # if PI
                @rotVector = @instYaxis.cross( @lineVector )
              end # if PI
              @trans       = Geom;;Transformation.rotation( ORIGIN, @rotVector, @rotDeg )
              @instance.transform!( @trans )
            end # if @rotDeg > 0.0
      
            # Moving the filament to the startPoint
            if not ( ORIGIN == startPoint )
              @trans       = Geom;;Transformation.new startPoint 
              @instance.transform!( @trans )
            end #if not ORIGEN
          end
      
      
      posted in Developers' Forum
      D
      Davidfi1
    • RE: ( [ 0,0,0 ].vector_to( [ 0,0,0 ] ) ).length.mm &lt; 0.01.mm

      Very informative site in did.
      Thank you.
      I am a hardware engineer by training - so I know this problem from the other side
      and still it is a little strange πŸ˜„

      posted in Developers' Forum
      D
      Davidfi1
    • RE: ( [ 0,0,0 ].vector_to( [ 0,0,0 ] ) ).length.mm &lt; 0.01.mm

      so to find the length of I should use length.to_f ?

      posted in Developers' Forum
      D
      Davidfi1
    • ( [ 0,0,0 ].vector_to( [ 0,0,0 ] ) ).length.mm &lt; 0.01.mm

      is this "true" or "false"?:
      ( [ 0,0,0 ].vector_to( [ 0,0,0 ] ) ).length.mm < 0.01.mm

      on my computer it is "false" - and I dont know why?

      posted in Developers' Forum
      D
      Davidfi1
    • RE: Help with transformation

      Dan, what did you say about the second point?
      I need to rotate the new component's x axis to be in line with the two points.

      posted in Developers' Forum
      D
      Davidfi1
    • Help with transformation

      Hi Guys
      I need some help using the correct Geom::Transformation.

      My task is to place a component and scale it's x axis, between two points.

      I need to figure out what is the Geom::Transformation needed for
      the add_instance method.
      Geom::Transformation.scaling xscale, 1, 1 will do the scaling
      Geom::Transformation.axes startPoint , xaxis, yaxis, zaxis
      moves the component to the first point and changes its axis

      How do I combine the transformations and what do I need to use for
      xscale, xaxis, yaxis, zaxis?

      Thank you
      David.

      posted in Developers' Forum
      D
      Davidfi1
    • RE: Ruby (eval):1: warning: Float out of range

      Dan,
      I made some progress making this importer a little more usable.
      Pleas see if you have more advice for me.

      P.S. I deleted all the old versions from this thread
      and updated the top thread's file.
      Thank you.
      David.

      posted in Developers' Forum
      D
      Davidfi1
    • RE: Ruby (eval):1: warning: Float out of range

      Well,
      I tried πŸ˜„
      Please see my attempt to follow your advice.
      I did not do the instruction in "[ code ] SketchupExtension and rbs rubies" yet...

      thank you
      Hope this importer will be usable.
      It seems that it take a long time to import the gcode
      And what is worse is the time it take for sketchup to render the lines that where imported.

      I am looking for a way to make it easier for sketchup to render - can you help?

      posted in Developers' Forum
      D
      Davidfi1
    • RE: Ruby (eval):1: warning: Float out of range

      Problem Solved! πŸ˜„
      So simple...

      Thank you.

      I am thinking about the next steps of making this a usable plugin
      What do you think?

      posted in Developers' Forum
      D
      Davidfi1
    • RE: Ruby (eval):1: warning: Float out of range

      The problem was using capital letters as variables
      The gcode importer imports G-Code πŸ˜„
      G-code in 3D production is the file that has the instruction for moving the motors of the printer.
      we have lots of ways to convert from STL to G-Code, But no general tool to see the results.
      I am tring to make this simple tool - if it will pruve possible technologically...

      posted in Developers' Forum
      D
      Davidfi1
    • RE: Ruby (eval):1: warning: Float out of range

      @jim said:

      David, maybe you could also attach your test gcode file?

      I use both attched files & I do not really know how to reproduce the warning,

      I belive it is a very silple thing - remember I am very new to all of this and this is my first attempt πŸ˜„


      tri_repetier.gcode.txt


      tri.gcode.txt

      posted in Developers' Forum
      D
      Davidfi1
    • Ruby (eval):1: warning: Float out of range

      Hi
      I am a beginner to ruby sketchup plugins.
      I am also a begginer in 3D printing.

      I was tring to see if I can write a G-Code importer to skethup.
      Attached you can see my preleminary importer code.

      The problem is that from time to time I get a worning I cannot understand.
      The warning is:
      (eval):1: warning: Float 15.0 out of range
      G1 Z=15.0F=180 x=0 y=0 z=15.0

      How can a float this small be out of range?

      http://sketchucation.com/forums/viewtopic.php?f=323&t=50067

      posted in Developers' Forum
      D
      Davidfi1
    • RE: Phisics

      put the ball in the hole.skp

      posted in SketchyPhysics
      D
      Davidfi1
    • RE: SketchUp crashes when i try to simulate model

      if you will post your model we could test and tell you if it works for us

      posted in SketchyPhysics
      D
      Davidfi1
    • RE: SketchyPhysics3.1

      Guys
      Could you please "STICK" this final version on the top of the forum?

      Thank you all very much.

      Good work!

      David.

      posted in SketchyPhysics
      D
      Davidfi1
    • 1 / 1