Hi.
While I'm waiting for the last stepper driver for my bot to arrive
(one was broken), I've been playing around a bit with sketchup. Has
anyone used any slice and gcode tool for sketchup? I found a slicer
plugin, and used the result as input to a small gcode-compiler I
started to write this evening.
Here I found the slicer:
http://www.cad-addict.com/2009/07/sketchup-plugins-slice-your-model.html
(in the forms for slicer I answered: slice-spacing 0.36m, slice-
thickness 0, then equalize spacing, leave selection hidden and no
flattened copy)
Then I added my really simple plugin to sketchup, which when tested
with a small cube outputted some gcode that Pleasant3d seemed to
accept. Has anyone done something similar and have any comments?
Would be nice to have skeinforge rewritten in ruby for sketchup. ;)
Well, just some thoughts,
Tobias
--- gcode.rb ---
require 'sketchup'
# Sketchup.send_action "showRubyPanel:"
UI.menu("PlugIns").add_item("Create G-code") { gcode }
def getfaces
model = Sketchup.active_model
entities = model.selection
entities.select do |e|
e.is_a?(Sketchup::Face)
end
end
def getgroupfaces
model = Sketchup.active_model
group = model.selection[0]
# get faces from the sliced model
(group.entities.to_a.map do |g|
g.entities.select do |e|
e.is_a?(Sketchup::Face)
end
end).flatten.reverse
end
def gcode
res = GCode::Header.clone
getgroupfaces.each do |e|
res << "(<layer>)\nM101\n"
e.outer_loop.vertices.each do |v|
res << "G1 X#{v.position.x.to_f} Y#{v.position.y.to_f}
Z#{v.position.z.to_f} F3300.0\n"
end
v = e.outer_loop.vertices[0]
res << "G1 X#{v.position.x.to_f} Y#{v.position.y.to_f}
Z#{v.position.z.to_f} F3300.0\n"
res << "M103\n(</layer>)\n"
end
filename = UI.savepanel("Save gcode", "", "x.gcode")
if filename
File.open(filename, "w") do |f|
f.write res
end
end
end
module GCode
Header = %Q{(homing routing)
M104 S220 T0 (Temperature to 220 celsius)
G21 (Metric FTW)
G90 (Absolute Positioning)
G92 X0 Y0 Z0 (You are now at 0,0,0)
(You have failed me for the last time, MakerBot)
G0 Z15 (Move up for test extrusion)
M108 S255 (Extruder speed = max)
M6 T0 (Wait for tool to heat up)
G04 P5000 (Wait 5 seconds)
M101 (Extruder on, forward)
G04 P5000 (Wait 5 seconds)
M103 (Extruder off)
M01 (The heater is warming up and will do a test extrusion. Click yes
after you have cleared the nozzle of the extrusion.)
G0 Z0 (Go back to zero.)
(end of start.)
(<creator> skeinforge June 8, 2009 </creator>)
(<extruderInitialization>)
G21
G90
G28
M103
M105
(<decimalPlacesCarried> 3 </decimalPlacesCarried>)
(<flowrateCubicMillimetersPerSecond> 4.473 </
flowrateCubicMillimetersPerSecond>)
(<layerThickness> 0.36 </layerThickness>)
(<extrusionPerimeterWidth> 0.468 </extrusionPerimeterWidth>)
(<outsideExtrudedFirst> True </outsideExtrudedFirst>)
(<feedrateMinute> 1560.0 </feedrateMinute>)
(<operatingFeedratePerSecond> 26.0 </operatingFeedratePerSecond>)
(<orbitalFeedratePerSecond> 26.0 </orbitalFeedratePerSecond>)
(<supportFlowrate> 255.0 </supportFlowrate)
(<travelFeedratePerSecond> 55.0 </travelFeedratePerSecond>)
(<extrusionWidth> 0.522 </extrusionWidth>)
(<fillInset> 0.4167 </fillInset>)
(<infillBridgeWidthOverExtrusionWidth> 1.0 </
infillBridgeWidthOverExtrusionWidth>)
(<procedureDone> carve </procedureDone>)
(<procedureDone> inset </procedureDone>)
(<procedureDone> fill </procedureDone>)
(<procedureDone> multiply </procedureDone>)
(<procedureDone> speed </procedureDone>)
(<procedureDone> raft /<procedureDone>)
(<procedureDone> comb </procedureDone>)
(<procedureDone> clip </procedureDone>)
(<procedureDone> oozebane </procedureDone>)
(<procedureDone> fillet </procedureDone>)
(<procedureDone> export </procedureDone>)
(</extruderInitialization>)
M108 S255.0
M104 S230.0
}
TAIL = %Q{(</extrusion>)
M103
M104 S0
(end of the file, cooldown routines)
M104 S0
G91
G1 X-18.8 Y18.85 Z10.0 F3300.0}
end
--
You received this message because you are subscribed to the Google Groups "MakerBot Operators" group.
To post to this group, send email to
make...@googlegroups.com.
To unsubscribe from this group, send email to
makerbot+u...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/makerbot?hl=en.