mirror of
https://github.com/niconson/PlatForm.git
synced 2026-10-21 12:50:48 +00:00
upd 3d model (Led-Driver)
This commit is contained in:
parent
e99cd5967b
commit
c186ccc725
15 changed files with 395 additions and 123 deletions
|
|
@ -62,8 +62,7 @@
|
|||
"drw_board_outline": "true",
|
||||
"drw_copper": "false",
|
||||
"drw_holes": "false",
|
||||
"drw_pads": "false",
|
||||
"frozen": "false"
|
||||
"drw_pads": "false"
|
||||
},
|
||||
"10: custom combo projection": {
|
||||
"MODE": "10",
|
||||
|
|
@ -77,26 +76,21 @@
|
|||
"drw_board_outline": "true",
|
||||
"drw_copper": "true",
|
||||
"drw_holes": "true",
|
||||
"drw_pads": "true",
|
||||
"pcb_section": "false"
|
||||
"drw_pads": "true"
|
||||
},
|
||||
"12: lateral 3D section": {
|
||||
"MODE": "12",
|
||||
"drw_board_outline": "true",
|
||||
"drw_copper": "true",
|
||||
"drw_holes": "true",
|
||||
"drw_pads": "true",
|
||||
"pcb_section": "true",
|
||||
"projection_true": "false",
|
||||
"view_dir": "false"
|
||||
"drw_pads": "true"
|
||||
},
|
||||
"13: top 3D section": {
|
||||
"MODE": "13",
|
||||
"drw_board_outline": "true",
|
||||
"drw_copper": "true",
|
||||
"drw_holes": "true",
|
||||
"drw_pads": "true",
|
||||
"view_dir": "true"
|
||||
"drw_pads": "true"
|
||||
},
|
||||
"14: boolean difference": {
|
||||
"MODE": "14",
|
||||
|
|
|
|||
|
|
@ -3,12 +3,18 @@
|
|||
| repositories https://github.com/niconson |
|
||||
| Niconson(R), All rights reserved |
|
||||
\-----------------------------------------------*/
|
||||
include <Driver_01.lib>
|
||||
include <Package.lib>
|
||||
|
||||
include <Driver_01/Driver_01.lib>
|
||||
include <Package/Package.lib>
|
||||
|
||||
board_color = "green";
|
||||
|
||||
// display parameter
|
||||
Convexity = 3;
|
||||
|
||||
// color option for import
|
||||
transparent = 0.5;
|
||||
|
||||
// pcb thickness
|
||||
board_h = 1.500;
|
||||
|
||||
|
|
@ -55,6 +61,9 @@ rotate_x = 0;
|
|||
// rotate around the Y axis
|
||||
rotate_y = 0;
|
||||
|
||||
// rotate around the Z axis
|
||||
rotate_z = 0;
|
||||
|
||||
// make projection for modes 1, 11...14
|
||||
projection_true = false;
|
||||
|
||||
|
|
@ -98,7 +107,7 @@ to use this option */
|
|||
module Main (custom=true)
|
||||
{
|
||||
// (this module cannot be modified by the user)
|
||||
if(E) Pcb_Driver_01(frozen);
|
||||
if(E) render(Convexity) Pcb_Driver_01(frozen);
|
||||
if(custom) Custom(object);
|
||||
}
|
||||
|
||||
|
|
@ -124,8 +133,9 @@ module Custom (obj=0)
|
|||
rotate([0,0,0])
|
||||
cube(10);
|
||||
*/
|
||||
translate([-6,-3.5,-9.000])
|
||||
Pcb_Package (true);
|
||||
color("LightGrey", alpha = transparent)
|
||||
translate([-6,-3.5,-9.000])
|
||||
Pcb_Package (true);
|
||||
}
|
||||
if(hide == 2){} else if (item == 2 || item == 0)
|
||||
{
|
||||
|
|
@ -140,15 +150,35 @@ module Custom (obj=0)
|
|||
}
|
||||
if(hide == 3){} else if (item == 3 || item == 0)
|
||||
{
|
||||
// add your object 3
|
||||
|
||||
// add your object 3, for example, import STL
|
||||
// Import a file from the OpenScad folder,
|
||||
// located relative to the PCB file:
|
||||
// <FPC_FILE>\related_files\openscad\<STL_FILE>
|
||||
// Use PrusaSlicer to repair STL models and
|
||||
// simplify polygonal meshes.
|
||||
/*
|
||||
color("LightGrey", alpha = transparent)
|
||||
translate([0.0,0.0,0.0])
|
||||
rotate([0,0,0])
|
||||
import("Driver_01/mainBody.stl", center = true, convexity = Convexity);
|
||||
*/
|
||||
}
|
||||
if(hide == 4){} else if (item == 4 || item == 0)
|
||||
{
|
||||
// add your object 4
|
||||
|
||||
/*
|
||||
color("MediumTurquoise", alpha = transparent)
|
||||
translate([0.0, 0.0, 0.0])
|
||||
rotate([0, 0, 0])
|
||||
import("Driver_01/Part1.stl", center = true, convexity = Convexity);
|
||||
*/
|
||||
}
|
||||
// object 5, etc.
|
||||
// if(hide == 5){} else if (item == 5 || item == 0)
|
||||
// if(hide == 6){} else if (item == 6 || item == 0)
|
||||
// if(hide == 7){} else if (item == 7 || item == 0)
|
||||
// if(hide == 8){} else if (item == 8 || item == 0)
|
||||
// if(hide == 9){} else if (item == 9 || item == 0)
|
||||
// end of custom field
|
||||
}
|
||||
}
|
||||
|
|
@ -250,7 +280,7 @@ else if (MODE == 11)
|
|||
//projection() rotate([-90,0,0])
|
||||
{
|
||||
if(!pcb_section) Main(0);
|
||||
render(Convexity) difference(){
|
||||
difference(){
|
||||
if(!pcb_section) Custom(object);
|
||||
else Main();
|
||||
CubeX();}
|
||||
|
|
@ -261,7 +291,7 @@ else if (MODE == 12)
|
|||
//projection() rotate([0,90,0])
|
||||
{
|
||||
if(!pcb_section) Main(0);
|
||||
render(Convexity) difference(){
|
||||
difference(){
|
||||
if(!pcb_section) Custom(object);
|
||||
else Main();
|
||||
CubeY();}
|
||||
|
|
@ -272,7 +302,7 @@ else if (MODE == 13)
|
|||
//projection()
|
||||
{
|
||||
Main(0);
|
||||
render(Convexity) difference(){
|
||||
difference(){
|
||||
Custom(object);
|
||||
CubeZ();}
|
||||
}
|
||||
|
|
@ -280,7 +310,7 @@ else if (MODE == 13)
|
|||
else if (MODE == 14)
|
||||
{
|
||||
//projection() translate([0,0,0]) rotate([0,0,0])
|
||||
render(Convexity) difference()
|
||||
difference()
|
||||
{
|
||||
Custom(object);
|
||||
//CubeX();
|
||||
|
|
@ -298,10 +328,10 @@ if (projection_true && (MODE > 10 || MODE == 1))
|
|||
{
|
||||
projection(via_origin)
|
||||
translate([0,0,offset])
|
||||
rotate([rotate_x,rotate_y,0])
|
||||
rotate([rotate_x,rotate_y,rotate_z])
|
||||
Drawing();
|
||||
}
|
||||
else
|
||||
translate([0,0,offset])
|
||||
rotate([rotate_x,rotate_y,0])
|
||||
rotate([rotate_x,rotate_y,rotate_z])
|
||||
Drawing();
|
||||
|
|
|
|||
|
|
@ -1146,7 +1146,7 @@ module Draw_BO_Driver_01 ()
|
|||
}
|
||||
|
||||
// board outline
|
||||
color( "green" )
|
||||
color( board_color )
|
||||
linear_extrude( board_h, center=true )
|
||||
polygon([[12.000, -5.250],
|
||||
[-12.000, -5.250],
|
||||
103
Projects/Led/version-01/related_files/openscad/Package.json
Normal file
103
Projects/Led/version-01/related_files/openscad/Package.json
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
{
|
||||
"fileFormatVersion": "1",
|
||||
"parameterSets" : {
|
||||
"1: full 3D view": {
|
||||
"MODE" : "1",
|
||||
"drw_board_outline" : "true",
|
||||
"drw_copper" : "true",
|
||||
"drw_holes" : "true",
|
||||
"drw_pads" : "true"
|
||||
},
|
||||
"2: projection of top copper": {
|
||||
"MODE" : "2",
|
||||
"drw_board_outline" : "true",
|
||||
"drw_copper" : "true",
|
||||
"drw_holes" : "true",
|
||||
"drw_pads" : "true"
|
||||
},
|
||||
"3: projection of bottom copper": {
|
||||
"MODE" : "3",
|
||||
"drw_board_outline" : "true",
|
||||
"drw_copper" : "true",
|
||||
"drw_holes" : "true",
|
||||
"drw_pads" : "true"
|
||||
},
|
||||
"4: projection of top packages": {
|
||||
"MODE" : "4",
|
||||
"drw_board_outline" : "false",
|
||||
"drw_copper" : "false",
|
||||
"drw_holes" : "false",
|
||||
"drw_pads" : "false"
|
||||
},
|
||||
"5: projection of bottom packages": {
|
||||
"MODE" : "5",
|
||||
"drw_board_outline" : "false",
|
||||
"drw_copper" : "false",
|
||||
"drw_holes" : "false",
|
||||
"drw_pads" : "false"
|
||||
},
|
||||
"6: lateral pcb projection": {
|
||||
"MODE" : "6",
|
||||
"drw_board_outline" : "true",
|
||||
"drw_copper" : "false",
|
||||
"drw_holes" : "false",
|
||||
"drw_pads" : "false"
|
||||
},
|
||||
"7: frontal pcb projection": {
|
||||
"MODE" : "7",
|
||||
"drw_board_outline" : "true",
|
||||
"drw_copper" : "false",
|
||||
"drw_holes" : "false",
|
||||
"drw_pads" : "false"
|
||||
},
|
||||
"8: custom lateral projection": {
|
||||
"MODE" : "8",
|
||||
"drw_board_outline" : "true",
|
||||
"drw_copper" : "false",
|
||||
"drw_holes" : "false",
|
||||
"drw_pads" : "false"
|
||||
},
|
||||
"9: custom frontal projection": {
|
||||
"MODE" : "9",
|
||||
"drw_board_outline" : "true",
|
||||
"drw_copper" : "false",
|
||||
"drw_holes" : "false",
|
||||
"drw_pads" : "false"
|
||||
},
|
||||
"10: custom combo projection": {
|
||||
"MODE" : "10",
|
||||
"drw_board_outline" : "true",
|
||||
"drw_copper" : "false",
|
||||
"drw_holes" : "false",
|
||||
"drw_pads" : "false"
|
||||
},
|
||||
"11: frontal 3D section": {
|
||||
"MODE" : "11",
|
||||
"drw_board_outline" : "true",
|
||||
"drw_copper" : "true",
|
||||
"drw_holes" : "true",
|
||||
"drw_pads" : "true"
|
||||
},
|
||||
"12: lateral 3D section": {
|
||||
"MODE" : "12",
|
||||
"drw_board_outline" : "true",
|
||||
"drw_copper" : "true",
|
||||
"drw_holes" : "true",
|
||||
"drw_pads" : "true"
|
||||
},
|
||||
"13: top 3D section": {
|
||||
"MODE" : "13",
|
||||
"drw_board_outline" : "true",
|
||||
"drw_copper" : "true",
|
||||
"drw_holes" : "true",
|
||||
"drw_pads" : "true"
|
||||
},
|
||||
"14: boolean difference": {
|
||||
"MODE" : "14",
|
||||
"drw_board_outline" : "false",
|
||||
"drw_copper" : "true",
|
||||
"drw_holes" : "true",
|
||||
"drw_pads" : "true"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3,13 +3,21 @@
|
|||
| repositories https://github.com/niconson |
|
||||
| Niconson(R), All rights reserved |
|
||||
\-----------------------------------------------*/
|
||||
include <Package.lib>
|
||||
Convexity = 2;
|
||||
|
||||
include <Package/Package.lib>
|
||||
|
||||
board_color = "green";
|
||||
|
||||
// display parameter
|
||||
Convexity = 3;
|
||||
|
||||
// color option for import
|
||||
transparent = 0.5;
|
||||
|
||||
// pcb thickness
|
||||
board_h = 1.500;
|
||||
|
||||
|
||||
|
||||
//// Drawing mode
|
||||
// drawing mode
|
||||
MODE = 1; // 1: full 3D view
|
||||
// 2: projection of top copper
|
||||
// 3: projection of bottom copper
|
||||
|
|
@ -22,72 +30,177 @@ MODE = 1; // 1: full 3D view
|
|||
// 8: custom lateral projection
|
||||
// 9: custom frontal projection
|
||||
// 10: custom combo projection
|
||||
// 11: frontal 3D section for Custom
|
||||
// 12: lateral 3D section for Custom
|
||||
// 13: top 3D section for Custom
|
||||
// 11: frontal 3D section
|
||||
// 12: lateral 3D section
|
||||
// 13: top 3D section
|
||||
// 14: boolean difference (makes
|
||||
// holes in the Custom objects
|
||||
// using 3d-models of pcb parts).
|
||||
|
||||
dir = 0; // view direction for 6...13 modes
|
||||
pdist = 20;// distance between projections for mode 10
|
||||
|
||||
// double-sided section for modes 4,5,11...13
|
||||
sector = 0.01;
|
||||
|
||||
// distance between projections for mode 10
|
||||
pdist = 20;
|
||||
|
||||
//// Drawing control
|
||||
// use positive values to isolate a custom object
|
||||
// use negative values to disable a custom object
|
||||
object = 0;
|
||||
|
||||
// cube size for 4,5,11-13 modes
|
||||
cube_scale = 2;
|
||||
|
||||
// total offset
|
||||
offset = 0.01;
|
||||
|
||||
// rotate around the X axis
|
||||
rotate_x = 0;
|
||||
|
||||
// rotate around the Y axis
|
||||
rotate_y = 0;
|
||||
|
||||
// rotate around the Z axis
|
||||
rotate_z = 0;
|
||||
|
||||
// make projection for modes 1, 11...14
|
||||
projection_true = false;
|
||||
|
||||
// projection via origin for modes 1, 11...14
|
||||
via_origin = false;
|
||||
|
||||
// view direction for modes 6...13
|
||||
view_dir= false;
|
||||
|
||||
// enable PCB section for modes 11...12
|
||||
pcb_section = true;
|
||||
|
||||
// drawing control
|
||||
E = true;
|
||||
drw_board_outline = (MODE!=4&&MODE!=5&&MODE!=14)?1:0;
|
||||
drw_copper = (MODE<4||MODE>10)?1:0;
|
||||
drw_holes = (MODE<4||MODE>10)?1:0;
|
||||
drw_pads = (MODE<4||MODE>10)?1:0;
|
||||
drw_Package_Package = E;
|
||||
|
||||
drw_board_outline = true;
|
||||
drw_copper = true;
|
||||
drw_holes = true;
|
||||
drw_pads = true;
|
||||
drw_Package_Package = true; // controls Draw_Package_Package();
|
||||
|
||||
//// 3d cube for boolean operations:
|
||||
cube_scaleX = cube_scale;
|
||||
cube_scaleY = cube_scale;
|
||||
cube_scaleZ = cube_scale;
|
||||
|
||||
|
||||
|
||||
//// Drawing modules
|
||||
/*
|
||||
coordinates:*/frozen = false;/* Wherever you move
|
||||
// frozen position
|
||||
frozen = false; /* coordinates: Wherever you move
|
||||
the PCB in the PCB editor, the position of the 3D
|
||||
model will remain the same. Make true if you want
|
||||
to use this option*/
|
||||
to use this option */
|
||||
|
||||
module Main (custom=true)
|
||||
{
|
||||
Pcb_Package(frozen);
|
||||
if(custom) Custom();
|
||||
// (this module cannot be modified by the user)
|
||||
if(E) render(Convexity) Pcb_Package(frozen);
|
||||
if(custom) Custom(object);
|
||||
}
|
||||
|
||||
module Custom ()
|
||||
//==================================================
|
||||
//================ CUSTOM ZONE ===================
|
||||
//==================================================
|
||||
module Custom (obj=0)
|
||||
{
|
||||
translate([frozen?0:originX_Package, frozen?0:originY_Package, 0])
|
||||
{
|
||||
// user field
|
||||
// custom field
|
||||
// add external objects here (optional)
|
||||
// for example, uncomment the following:
|
||||
/*
|
||||
color("aqua", 0.5)
|
||||
translate([0,0,0])
|
||||
rotate([0,0,0])
|
||||
cube(10);
|
||||
*/
|
||||
/*
|
||||
// add any PCB from the project folder,
|
||||
// any pcb in the project folder will require
|
||||
// the <.lib> header (See top) to be included:
|
||||
render(Convexity)
|
||||
translate([0,0,50.000])
|
||||
Pcb_Package (true);
|
||||
*/
|
||||
// end of user field
|
||||
hide = (obj<0?-obj:0);
|
||||
item = (obj<0?0:obj);
|
||||
|
||||
if(hide == 1){} else if (item == 1 || item == 0)
|
||||
{
|
||||
// add your object 1
|
||||
// for example, uncomment the following:
|
||||
/*
|
||||
color("aqua", 0.5)
|
||||
translate([0,0,0])
|
||||
rotate([0,0,0])
|
||||
cube(10);
|
||||
*/
|
||||
}
|
||||
if(hide == 2){} else if (item == 2 || item == 0)
|
||||
{
|
||||
// add your object 2, for example, another PCB
|
||||
// from the project folder. For any PCB, you will
|
||||
// need to include the <.lib> header file(see above):
|
||||
/*
|
||||
render(Convexity)
|
||||
translate([0,0,50.000])
|
||||
Pcb_Package (true);
|
||||
*/
|
||||
}
|
||||
if(hide == 3){} else if (item == 3 || item == 0)
|
||||
{
|
||||
// add your object 3, for example, import STL
|
||||
// Import a file from the OpenScad folder,
|
||||
// located relative to the PCB file:
|
||||
// <FPC_FILE>\related_files\openscad\<STL_FILE>
|
||||
// Use PrusaSlicer to repair STL models and
|
||||
// simplify polygonal meshes.
|
||||
/*
|
||||
color("LightGrey", alpha = transparent)
|
||||
translate([0.0,0.0,0.0])
|
||||
rotate([0,0,0])
|
||||
import("Package/mainBody.stl", center = true, convexity = Convexity);
|
||||
*/
|
||||
}
|
||||
if(hide == 4){} else if (item == 4 || item == 0)
|
||||
{
|
||||
// add your object 4
|
||||
/*
|
||||
color("MediumTurquoise", alpha = transparent)
|
||||
translate([0.0, 0.0, 0.0])
|
||||
rotate([0, 0, 0])
|
||||
import("Package/Part1.stl", center = true, convexity = Convexity);
|
||||
*/
|
||||
}
|
||||
// object 5, etc.
|
||||
// if(hide == 5){} else if (item == 5 || item == 0)
|
||||
// if(hide == 6){} else if (item == 6 || item == 0)
|
||||
// if(hide == 7){} else if (item == 7 || item == 0)
|
||||
// if(hide == 8){} else if (item == 8 || item == 0)
|
||||
// if(hide == 9){} else if (item == 9 || item == 0)
|
||||
// end of custom field
|
||||
}
|
||||
}
|
||||
//==================================================
|
||||
//============== END OF CUSTOM ZONE ==============
|
||||
//==================================================
|
||||
|
||||
module CubeX (d=view_dir)
|
||||
{
|
||||
color("white")
|
||||
translate([0, frozen?-originY_Package:0, frozen?(d?-max_height_Package/2:max_height_Package/2):0])
|
||||
rotate([d?90:-90, 0, 0])
|
||||
Draw_Package_CUBE(0, frozen, sector);
|
||||
}
|
||||
module CubeY (d=view_dir)
|
||||
{
|
||||
color("white")
|
||||
translate([frozen?-originX_Package:0, 0, frozen?(d?max_height_Package/2:-max_height_Package/2):0])
|
||||
rotate([0, d?90:-90, 0])
|
||||
Draw_Package_CUBE(0, frozen, sector);
|
||||
}
|
||||
module CubeZ (d=view_dir)
|
||||
{
|
||||
color("white")
|
||||
translate([0,0,0])
|
||||
Draw_Package_CUBE(d?1:0, frozen, sector);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//// Drawing
|
||||
cube_scaleX = 1.0;// (cube sizeX for 4,5,11,12,13 modes)
|
||||
cube_scaleY = 1.0;// (cube sizeY for 4,5,11,12,13 modes)
|
||||
cube_scaleZ = 1.0;// (cube sizeZ for 4,5,11,12,13 modes)
|
||||
module Drawing()
|
||||
if (MODE == 1)
|
||||
Main();
|
||||
else if (MODE == 2)
|
||||
|
|
@ -102,29 +215,29 @@ else if (MODE == 3)
|
|||
else if (MODE == 4)
|
||||
projection()difference(){
|
||||
Main(0);
|
||||
Draw_Package_CUBE(0, frozen);}
|
||||
CubeZ(0);}
|
||||
else if (MODE == 5)
|
||||
//mirror([1, 0, 0])
|
||||
projection()difference(){
|
||||
Main(0);
|
||||
Draw_Package_CUBE(1, frozen);}
|
||||
CubeZ(1);}
|
||||
else if (MODE == 6)
|
||||
projection()
|
||||
rotate([0, dir?-90:90, 0])
|
||||
rotate([0, view_dir?-90:90, 0])
|
||||
Main(0);
|
||||
else if (MODE == 7)
|
||||
projection()
|
||||
rotate([dir?90:-90, 0, 0])
|
||||
rotate([view_dir?90:-90, 0, 0])
|
||||
Main(0);
|
||||
else if (MODE == 8)
|
||||
projection(true)
|
||||
translate([0, 0, frozen?(dir?originX_Package:-originX_Package):0])
|
||||
rotate([0, dir?-90:90, 0])
|
||||
translate([0, 0, frozen?(view_dir?originX_Package:-originX_Package):0])
|
||||
rotate([0, view_dir?-90:90, 0])
|
||||
Main();
|
||||
else if (MODE == 9)
|
||||
projection(true)
|
||||
translate([0, 0, frozen?(dir?originY_Package:-originY_Package):0])
|
||||
rotate([dir?90:-90, 0, 0])
|
||||
translate([0, 0, frozen?(view_dir?originY_Package:-originY_Package):0])
|
||||
rotate([view_dir?90:-90, 0, 0])
|
||||
Main();
|
||||
else if (MODE == 10)
|
||||
{
|
||||
|
|
@ -132,21 +245,21 @@ else if (MODE == 10)
|
|||
rotate(90)
|
||||
{
|
||||
projection(true)
|
||||
translate([0, 0, frozen?(dir?originX_Package:-originX_Package):0])
|
||||
rotate([0, dir?-90:90, 0])
|
||||
Custom();
|
||||
translate([0, 0, frozen?(view_dir?originX_Package:-originX_Package):0])
|
||||
rotate([0, view_dir?-90:90, 0])
|
||||
Custom(object);
|
||||
projection()
|
||||
rotate([0, dir?-90:90, 0])
|
||||
Main(0);
|
||||
rotate([0, view_dir?-90:90, 0])
|
||||
Main(0);
|
||||
}
|
||||
render()// combines intersecting projections
|
||||
render()// (combines intersecting projections)
|
||||
{
|
||||
projection(true)
|
||||
translate([0, 0, frozen?(dir?originY_Package:-originY_Package):0])
|
||||
rotate([dir?90:-90, 0, 0])
|
||||
Custom();
|
||||
projection()
|
||||
rotate([dir?90:-90, 0, 0])
|
||||
projection(true)
|
||||
translate([0, 0, frozen?(view_dir?originY_Package:-originY_Package):0])
|
||||
rotate([view_dir?90:-90, 0, 0])
|
||||
Custom(object);
|
||||
projection()
|
||||
rotate([view_dir?90:-90, 0, 0])
|
||||
Main(0);
|
||||
}
|
||||
projection(true)
|
||||
|
|
@ -155,37 +268,62 @@ else if (MODE == 10)
|
|||
}
|
||||
else if (MODE == 11)
|
||||
{
|
||||
PcbFull = 0; // make 1 for full pcb view
|
||||
difference(){
|
||||
if(PcbFull) Custom();
|
||||
else Main();
|
||||
color("white")
|
||||
translate([0, frozen?-originY_Package:0, frozen?(dir?-max_height_Package/2:max_height_Package/2):0])
|
||||
rotate([dir?90:-90, 0, 0])
|
||||
Draw_Package_CUBE(0, frozen);}
|
||||
if(PcbFull) Main(0);
|
||||
//projection() rotate([-90,0,0])
|
||||
{
|
||||
if(!pcb_section) Main(0);
|
||||
difference(){
|
||||
if(!pcb_section) Custom(object);
|
||||
else Main();
|
||||
CubeX();}
|
||||
}
|
||||
}
|
||||
else if (MODE == 12)
|
||||
{
|
||||
PcbFull = 0; // make 1 for full pcb view
|
||||
difference(){
|
||||
if(PcbFull) Custom();
|
||||
else Main();
|
||||
color("white")
|
||||
translate([frozen?-originX_Package:0, 0, frozen?(dir?max_height_Package/2:-max_height_Package/2):0])
|
||||
rotate([0, dir?90:-90, 0])
|
||||
Draw_Package_CUBE(0, frozen);}
|
||||
if(PcbFull) Main(0);
|
||||
//projection() rotate([0,90,0])
|
||||
{
|
||||
if(!pcb_section) Main(0);
|
||||
difference(){
|
||||
if(!pcb_section) Custom(object);
|
||||
else Main();
|
||||
CubeY();}
|
||||
}
|
||||
}
|
||||
else if (MODE == 13)
|
||||
{
|
||||
difference(){
|
||||
Custom();
|
||||
translate([0,0,0])
|
||||
Draw_Package_CUBE(dir?1:0, frozen);}
|
||||
Main(0);
|
||||
//projection()
|
||||
{
|
||||
Main(0);
|
||||
difference(){
|
||||
Custom(object);
|
||||
CubeZ();}
|
||||
}
|
||||
}
|
||||
else if (MODE == 14)
|
||||
difference(){
|
||||
Custom();
|
||||
Main(0);}
|
||||
{
|
||||
//projection() translate([0,0,0]) rotate([0,0,0])
|
||||
difference()
|
||||
{
|
||||
Custom(object);
|
||||
//CubeX();
|
||||
//CubeY();
|
||||
//CubeZ();
|
||||
Main(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (projection_true && (MODE > 10 || MODE == 1))
|
||||
{
|
||||
projection(via_origin)
|
||||
translate([0,0,offset])
|
||||
rotate([rotate_x,rotate_y,rotate_z])
|
||||
Drawing();
|
||||
}
|
||||
else
|
||||
translate([0,0,offset])
|
||||
rotate([rotate_x,rotate_y,rotate_z])
|
||||
Drawing();
|
||||
|
||||
|
|
@ -18,11 +18,11 @@ module Pcb_Package (frozen)
|
|||
{
|
||||
if( is_undef(drw_Package_Package) )
|
||||
Draw_Package_Package();
|
||||
else if( drw_Package_Package != 0 )
|
||||
else if( drw_Package_Package )
|
||||
Draw_Package_Package();
|
||||
if( is_undef(drw_board_outline) )
|
||||
Draw_BO_Package();
|
||||
else if( drw_board_outline != 0 )
|
||||
else if( drw_board_outline )
|
||||
Draw_BO_Package();
|
||||
}
|
||||
}
|
||||
|
|
@ -8,19 +8,26 @@
|
|||
originX_Package = -3.592;
|
||||
originY_Package = -3.592;
|
||||
max_height_Package = 56.182;
|
||||
module Draw_Package_CUBE(side, var)
|
||||
module Draw_Package_CUBE(side, frozen, space)
|
||||
{
|
||||
if (is_undef(cube_scaleX) || is_undef(cube_scaleY) || is_undef(cube_scaleZ))
|
||||
{
|
||||
translate([max_height_Package/2, max_height_Package/2, 0])
|
||||
translate([var?0:originX_Package, var?0:originY_Package, side?max_height_Package/2-board_h:-max_height_Package/2])
|
||||
translate([frozen?0:originX_Package, frozen?0:originY_Package, side?max_height_Package/2-board_h:-max_height_Package/2])
|
||||
cube(max_height_Package, center=true);
|
||||
}
|
||||
else
|
||||
{
|
||||
translate([max_height_Package/2, max_height_Package/2, 0])
|
||||
translate([var?0:originX_Package, var?0:originY_Package, side?(max_height_Package/2*cube_scaleZ)-board_h:(-max_height_Package/2*cube_scaleZ) ])
|
||||
translate([frozen?0:originX_Package, frozen?0:originY_Package, side?(max_height_Package/2*cube_scaleZ)-board_h:(-max_height_Package/2*cube_scaleZ) ])
|
||||
scale([cube_scaleX, cube_scaleY, cube_scaleZ])
|
||||
cube(max_height_Package, center=true);
|
||||
if(space > 0.02)
|
||||
{
|
||||
push_direction = side ? -1 : 1;
|
||||
spaceAxisForCube = space + (max_height_Package * cube_scaleZ);
|
||||
translate([0, 0, push_direction * spaceAxisForCube])
|
||||
Draw_Package_CUBE(side, frozen, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
//============================================
|
||||
// Code builder for OpenScad via Freepcb-2
|
||||
// Author: niconson.com (c) 2014-2025
|
||||
// Sites: https://niconson.com/freepcb2
|
||||
// https://github.com/niconson
|
||||
// Code builder for OpenScad
|
||||
// Site: https://github.com/niconson
|
||||
//============================================
|
||||
|
||||
|
||||
|
||||
|
||||
// Polylines
|
||||
module Poly0_Package_Package ()
|
||||
{
|
||||
Loading…
Add table
Add a link
Reference in a new issue