Skip to content

Instantly share code, notes, and snippets.

@sylefeb
Last active March 15, 2024 15:29
Show Gist options
  • Select an option

  • Save sylefeb/dc1fceb91832ac995e13014257fbbbd1 to your computer and use it in GitHub Desktop.

Select an option

Save sylefeb/dc1fceb91832ac995e13014257fbbbd1 to your computer and use it in GitHub Desktop.
-- brush exemple
hole = cylinder(2,10)
ring = difference(cylinder(4,10),hole)
plate = difference(cube(40,40,10),hole)
emit(plate,1)
emit(ring,0)
emit(cube(50,50,10))
set_setting_value("num_shells_0", 0)
set_setting_value("print_perimeter_0", false)
set_setting_value("cover_thickness_mm_0", 0)
set_setting_value("infill_type_0","Phasor")
set_setting_value("phasor_infill_iso_0", 0)
angle = tex3d_r8f(64,64,64)
for i = 0,63 do
for j = 0,63 do
for k = 0,63 do
a = 0.5*i/63.0
angle:set(i,j,k, v(a,0.0,0.0))
end
end
end
set_setting_value('phasor_infill_theta_0',angle,v(-25,-25,0),v(25,25,10))
emit(cube(50,50,10))
set_setting_value("num_shells_0", 0)
set_setting_value("print_perimeter_0", false)
set_setting_value("cover_thickness_mm_0", 0)
set_setting_value("infill_type_0","Polyfoam")
set_setting_value("kgon_x_shrink_0", 0)
set_setting_value("infill_percentage_0",30)
angle = tex3d_r8f(64,64,64)
for i = 0,63 do
for j = 0,63 do
for k = 0,63 do
a = 0.5*i/63.0
angle:set(i,j,k, v(a,0.0,0.0))
end
end
end
set_setting_value('infill_angle_0',angle,v(-25,-25,0),v(25,25,10))
emit(cube(50,50,10))
set_setting_value("num_shells_0", 0)
set_setting_value("print_perimeter_0", false)
set_setting_value("cover_thickness_mm_0", 0)
set_setting_value("infill_type_0","Polyfoam")
set_setting_value("kgon_x_shrink_0", 0)
set_setting_value("infill_percentage_0",30)
--[[
angle = tex3d_r8f(64,64,64)
for i = 0,63 do
for j = 0,63 do
for k = 0,63 do
a = (180.0 + atan2((i-31.5),(j-31.5))) / 360.0
angle:set(i,j,k, v(a,0.0,0.0))
end
end
end
end
set_setting_value('infill_angle_0',angle,v(-25,-25,0),v(25,25,10))
]]
inner_radius = ui_scalar('inner radius',5,1,10)
outer_radius = 15
thickness = 4
center = cylinder(inner_radius-1,thickness)
branch = translate(0,0,thickness/2)
* rotate(90,0,0)
* scale(1,thickness/(inner_radius*2.0),1)
* cone(inner_radius,0,outer_radius)
n_branches = math.floor( ui_scalar('branches',5,1,10) )
branches = {}
for b=0,n_branches-1 do
branches[#branches+1] = rotate(0,0,b*360/n_branches) * branch
end
envelope = translate(0,0,thickness/2)*cylinder(outer_radius,thickness)
emit( intersection(envelope,difference(union(branches),center) ))
@sylefeb
Copy link
Author

sylefeb commented Mar 15, 2024

TODO:

  • to be sent by email to Sylvain dot Lefebvre at inria dot fr
  • expected 30/03 by midnight, commented code + README.md with a couple paragraphs to highlight the main points of your design
  • I will confirm reception, if I do not, then I did not receive your work, so please resend after 24 hours.
  • tripod modeling with polyfoam infill structure, see picture
  • parameterize all dimensions but the center hole diameter, the shape should not disconnect (split) for dimensions in range [1-100] mm
  • place the foam in brush 1 to have a solid ring in brush 0
  • beware that foam orientation is constant within a branch
  • bonus: varying density

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment