Commit 717b837d by Hubert

first testprinted version

0 parents
// Library: MinkowskiRound.scad
// Version: 1.0
// Author: IrevDev
// Copyright: 2017
// License: GPL 3
/*
---Modules
round2d(outside radius,internal radius) -> takes 2d children
This module will round 2d any shape
minkowskiRound(outsideRadius,internalRadius,enable,envelopecube[x,y,z]) -> takes 3d children
This module will round any 3d shape though it takes a long time, possibly more than 12 hours (use a low $fn value, 10-15 to begin with) so make sure enable is set to 0 untill you are ready for final render,the envelopecube must be bigger than the object you are rounding, default values are [500,500,500].
minkowskiOutsideRound(radius,enable,envelopecube[x,y,z])
minkowskiInsideRound(radius,enable,envelopecube[x,y,z])
Both this modules do the same thing as minkowskiRound() but focus on either inside or outside radiuses, which means these modules use one less minkowski() (two instead of three) making them quicker if you don't want both inside and outside radiuses.
--Examples
*/
//round2d(1,6)difference(){square([20,20]);square([10,10]);}
//minkowskiRound(3,1.5,1)theshape();
//minkowskiInsideRound(3,1)theshape();
//minkowskiOutsideRound(3,1)theshape();
//---good test child for examples
//module theshape(){//example shape
// difference(){
// cube([20,20,20]);
// cube([10,10,10]);
// }
//}
//minkowskiRound(0.5,2,1,[50,50,50])union(){//--example in the thiniverse thumbnail/main image
// cube([6,6,22]);
// rotate([30,45,10])cylinder(h=22,d=10);
//}//--I rendered this out with a $fn=25 and it took more than 12 hours on my computer
module round2d(OR=3,IR=1){
offset(OR){
offset(-IR-OR){
offset(IR){
children();
}
}
}
}
module minkowskiRound(OR=1,IR=1,enable=1,cubeSize=[500,500,500]){
if(enable==0){//do nothing if not enabled
children();
} else {
minkowski(){//expand the now positive shape back out
difference(){//make the negative shape positive again
cube(cubeSize-[0.1,0.1,0.1],center=true);
minkowski(){//expand the negative shape inwards
difference(){//create a negative of the children
cube(cubeSize,center=true);
minkowski(){//expand the children
children();
sphere(IR);
}
}
sphere(OR+IR);
}
}
sphere(OR);
}
}
}
module minkowskiOutsideRound(r=1,enable=1,cubeSize=[500,500,500]){
if(enable==0){//do nothing if not enabled
children();
} else {
minkowski(){//expand the now positive shape
difference(){//make the negative positive
cube(cubeSize-[0.1,0.1,0.1],center=true);
minkowski(){//expand the negative inwards
difference(){//create a negative of the children
cube(cubeSize,center=true);
children();
}
sphere(r);
}
}
sphere(r);
}
}
}
module minkowskiInsideRound(r=1,enable=1,cubeSize=[500,500,500]){
if(enable==0){//do nothing if not enabled
children();
} else {
difference(){//make the negative positive again
cube(cubeSize-[0.1,0.1,0.1],center=true);
minkowski(){//expand the negative shape inwards
difference(){//make the expanded children a negative shape
cube(cubeSize,center=true);
minkowski(){//expand the children
children();
sphere(r);
}
}
sphere(r);
}
}
}
}
\ No newline at end of file
include <libs/polyround.scad>
include <libs/uploads_6f_12_f1_10_d2_ISOThread.scad>
TOLLERANCE = 0.15;
T = TOLLERANCE;
THREAD_TOLLERANCE = 0.3 ;
TT = THREAD_TOLLERANCE;
fn=20;
// FRAME PARAMETERS
FRAME_INNER_RADIUS_NEAR_HUB = 10;
FRAME_OUTER_RADIUS_NEAR_HANGER = 10;
// PLATE PARAMETERS
FIX_PLATE_SPAN_X = 56.7;
FIX_PLATE_SPAN_Y = 27;
FIX_PLATE_HEIGHT = 4.8;
FIX_PLATE_EDGE = 1.5;
// HUB GROOVE
HUB_DIAMETER = 8.5;
HUB_OFFSET_X = 14.5 + HUB_DIAMETER / 2;
HUB_OFFSET_Y = 9.3 + HUB_DIAMETER / 2;
HUB_DIAMETER_SPACER = 16;
HUB_DIAMETER_SPACER_HEIGHT = 3;
HUB_DIAMETER_FRAME_SPACER = 20;
HUB_DIAMETER_FRAME_SPACER_HEIGHT = 1.8;
// HANGER PARAMETERS
HANGER_HEIGHT = 8;
HANGER_THREAD_OFFSET = 14.5;
HANGER_THREAD_DIAMETER = 10; // todo
HANGER_SAFETY_WIDTH = 6; // it looks so flimsy
HANGER_WIDTH = HUB_OFFSET_X - HUB_DIAMETER / 2;
HANGER_SPAN = HANGER_THREAD_OFFSET + HANGER_WIDTH / 2;
// FIXING PIN HOLE
FIX_PIN_DIAMETER = 10.3;
FIX_PIN_HEAD_DIAMETER = 12.5;
FIX_PIN_HEAD_RECESS_HEIGHT = 1.5; // HEIGHT OF THE RECESS THAT GRABS THE PIN !!, PINHEAD DISTANCE TO FRAME !!
// semi computed
// SET OFFSET OR BORDER
// OFFSET
/* FIX_OFFSET = 8; // center of fixation pin */
// BORDER
FIX_BORDER = 2.5; // border of plate to fixation pin distance
FIX_OFFSET = FIX_PIN_DIAMETER / 2 + FIX_BORDER; // computed center of fixation pin
// output
difference() {
hanger_wedge_plate();
fixing_pin();
hub_grove();
tensioner_thread();
}
// tensioner thread hole
module tensioner_thread() {
difference() {
translate([HANGER_WIDTH / 2, FIX_PLATE_SPAN_Y + HANGER_THREAD_OFFSET ,-1]){
cylinder(h = 20, d = HANGER_THREAD_DIAMETER + TT, center = false, $fn = fn);
}
translate([HANGER_WIDTH / 2, FIX_PLATE_SPAN_Y + HANGER_THREAD_OFFSET ,-1])
thread_in_pitch(HANGER_THREAD_DIAMETER + TT,HANGER_HEIGHT+3, 1);
}
}
// fixing pin hole
module fixing_pin() {
ankathete = FIX_OFFSET / tan(22.5);
translate([FIX_PLATE_SPAN_X,0,0]){
translate([ -ankathete, FIX_OFFSET, -1 ]){
cylinder(h = 20, d = FIX_PIN_DIAMETER + TT, center = false, $fn = fn);
cylinder(h = FIX_PLATE_HEIGHT - FIX_PIN_HEAD_RECESS_HEIGHT + 1, d = FIX_PIN_HEAD_DIAMETER + TT, center = false, $fn = fn);
}
}
}
// hub groove
module hub_grove() {
union() {
hull() {
translate([ HUB_OFFSET_X, HUB_OFFSET_Y, 0 ]){
cylinder(h = 20, d = HUB_DIAMETER + T, center = true, $fn = fn);
}
translate([ HUB_OFFSET_X, FIX_PLATE_SPAN_Y + T, 0 ]){
cylinder(h = 20, d = HUB_DIAMETER + T, center = true, $fn = fn);
}
}
translate([ HUB_OFFSET_X, HUB_OFFSET_Y, FIX_PLATE_HEIGHT - HUB_DIAMETER_FRAME_SPACER_HEIGHT]){
cylinder(h = HUB_DIAMETER_FRAME_SPACER_HEIGHT + 1, d = HUB_DIAMETER_FRAME_SPACER + TT, center = false, $fn = fn);
}
translate([ HUB_OFFSET_X, HUB_OFFSET_Y, -1]){
cylinder(h = 10, d = HUB_DIAMETER_SPACER + TT, center = false, $fn = fn);
}
translate([ HUB_OFFSET_X, HUB_OFFSET_Y, FIX_PLATE_HEIGHT - ( HUB_DIAMETER_FRAME_SPACER_HEIGHT + HUB_DIAMETER_SPACER_HEIGHT + 10) ]){
cylinder(h = 10, d = 20 + TT, center = false, $fn = fn);
}
}
}
// hanger wedge plate
module hanger_wedge_plate() {
union() { // combine fixation plate with hangerblock
// fix plate
fix_plate_shape = [ [FIX_PLATE_EDGE + T,FIX_PLATE_EDGE + T,FRAME_INNER_RADIUS_NEAR_HUB]
, [FIX_PLATE_SPAN_X - ( FIX_PLATE_EDGE / tan(22.5) + T / tan(22.5) ),FIX_PLATE_EDGE + T,FIX_OFFSET-FIX_PLATE_EDGE]
, [FIX_PLATE_EDGE + T,FIX_PLATE_SPAN_X - ( FIX_PLATE_EDGE / tan(22.5) + T / tan(22.5) ),0]
];
difference() { // cut shape where the bike frame ends
minkowski() {// combine fixation plate with edged corner
linear_extrude( height = FIX_PLATE_HEIGHT - FIX_PLATE_EDGE)
polygon(
polyRound(
fix_plate_shape, fn
));
linear_extrude(height = FIX_PLATE_EDGE, scale=0)
circle(r = FIX_PLATE_EDGE);
}
translate([ 0
, FIX_PLATE_SPAN_Y + T
, -1
])cube(50,50,100);
}
/* FRAME_OUTER_CURVE_NEAR_HANGER */
// hangerblock
hanger_shape = [ [ T, FIX_PLATE_SPAN_Y - FRAME_OUTER_RADIUS_NEAR_HANGER + T, 0]
, [ FRAME_OUTER_RADIUS_NEAR_HANGER - cos(45) * FRAME_OUTER_RADIUS_NEAR_HANGER + T
, FIX_PLATE_SPAN_Y - FRAME_OUTER_RADIUS_NEAR_HANGER + sin(45)*FRAME_OUTER_RADIUS_NEAR_HANGER + T
, 0
]
, [FRAME_OUTER_RADIUS_NEAR_HANGER + T,FIX_PLATE_SPAN_Y + T,0]
, [HANGER_WIDTH - T ,FIX_PLATE_SPAN_Y + T,0]
, [HANGER_WIDTH - T,FIX_PLATE_SPAN_Y + HANGER_SPAN - T, HANGER_WIDTH/2 - T]
, [T,FIX_PLATE_SPAN_Y + HANGER_SPAN - T, HANGER_WIDTH / 2 - T]
];
difference() {
// hanger
linear_extrude( height = HANGER_HEIGHT)
polygon(
polyRound(
hanger_shape, fn
));
// cut out dropout frame corner
translate([FRAME_OUTER_RADIUS_NEAR_HANGER - T * 3 /*better safe than sorry*/ , FIX_PLATE_SPAN_Y - FRAME_OUTER_RADIUS_NEAR_HANGER,0])
cylinder(h = HANGER_HEIGHT + 1, d = HANGER_THREAD_DIAMETER*2 +T, center = false, $fn = fn*2);
}
// safety diameter probabaly unnecessary
if (HANGER_THREAD_DIAMETER + HANGER_SAFETY_WIDTH > HANGER_WIDTH) {
translate([HANGER_WIDTH / 2, FIX_PLATE_SPAN_Y + HANGER_THREAD_OFFSET , 0])
cylinder(h = HANGER_HEIGHT, d = HANGER_THREAD_DIAMETER + HANGER_SAFETY_WIDTH, center = false, $fn = fn);
}
}
}
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!