[OpenSCAD] 2D, 3D OpenSCAD Problem

Higraphics hichm19956 at gmail.com
Sat Oct 26 14:33:32 EDT 2019


// Size of 2KG of Gold Linget Fonte
// 10mm x 4.3mm X 2.41mm
// Calculated from Density of gold = 19.30 g/cm3 at 20°C
// 30 => 4.3
// 100 => 10
// 30 h =>2.41 
// 25 => 3.15
// 5 => 1.15
// 95 => 8.85

l=4.3;
L=10;
h=2.41;

top_x= (l/2)-1; // top_x=1.15
bottom_x= l-top_x; // bottom_x=3.15
L_R_h= L-top_x; // L_R_h=8.85

Points=[[0,0,0],[l,0,0],[bottom_x,top_x,h],[top_x,top_x,h],[top_x,L_R_h,h],[0,L,0],[l,L,0],[bottom_x,L_R_h,h]];

Paths=[[0,1,3],[1,3,2],[0,5,3],[5,3,4],[5,6,7],[5,7,4],[6,1,2],[7,2,6],[2,3,7],[3,7,4],[0,1,5],[1,5,6]];

module text_w() {
    color( "Black" ) {
translate([-(bottom_x/1.95)+1.06,2,h/2])
resize([1,0.5,0])
    linear_extrude(height=0.005) text("Gold");
translate([-(bottom_x/1.95)+1.07,-2,h/2])
resize([1,0.5,0])
    linear_extrude(height=0.005) text("2 Kg");
translate([-(bottom_x/1.95)+1.07,-3,h/2])
resize([1,0.4,0])
    linear_extrude(height=0.005) text("70.5479 oz");
}   
}

module Torn() { 
    difference(){
    resize([1.6,1.2,0])
    linear_extrude(height=0.005) circle(r=5, center=true, $fn=250);
    translate([0,0,-0.001])
    resize([1.4,1,0])
    linear_extrude(height=0.01) circle(r=2, center=true, $fn=250);
    }   
}

translate([0,2.25,h/1.99]){
Torn();
} 

module objet(){
    union(){
    translate([-l/2,-L/2,-h/2])
    polyhedron(points=Points, faces=Paths);  
}
}

// difference not working in polyhedron
difference(){
    objet();
    text_w();
}



--
Sent from: http://forum.openscad.org/



More information about the Discuss mailing list