Browse Source

add Makefile for 3d models

master
Schoenberger, Philipp 6 years ago
parent
commit
0117678aa4
  1. 60
      3d/Makefile
  2. 8
      3d/remote.scad
  3. 13
      3d/stick.scad
  4. 5
      remote/include/config.h

60
3d/Makefile

@ -0,0 +1,60 @@
NAMES = phschoen
NAMES += Sina
NAMES += Malaika
NAMES += Pauline
NAMES += Mara
NAMES += Marleen
BUILDDIR := ./build
REMOTES_WITH_NAME := $(NAMES:%=$(BUILDDIR)/test_%.stl)
.PHONY: all
all:
define scad_to_stl
$(1:%.scad=$(BUILDDIR)/%.stl)
endef
#builddir
all: $(BUILDDIR)
$(BUILDDIR):
mkdir $@
$(BUILDDIR)/%: ./build
.PHONY: clean
clean:
rm -rf $(BUILDDIR)
define build_stl
all:$1
$1: $(BUILDDIR)/$1$(patsubst %,_%, $3).stl
$(BUILDDIR)/$1$(patsubst %,_%, $3).stl : $1.scad
@echo "Generate $1"
@$(patsubst %,echo " with %";, $2)
openscad -o $$@ $$< -D "$2"
endef
#####################################
# actual targest
$(eval $(call build_stl ,quad_charge_plug))
$(eval $(call build_stl ,stick,is_ps2_stick=0))
$(eval $(call build_stl ,stick,is_ps2_stick=1))
$(foreach a,$(NAMES), $(eval $(call build_stl ,quad, name=\"$a\",$a)))
REMOTE_REST=enable_text_engrave=0; show_switch=0; show_lcd=0; show_sticks=0; show_stm32=0; show_antenna=0; show_cc2500=0; show_batery_charger=0; show_batery=0; show_joysticks_pcb=0; show_usb_connector=0;
REMOTE_TOP :=show_top=1; show_bottom=0; show_strapholder=0; show_grip=0; $(REMOTE_REST)
REMOTE_BOTTOM:=show_top=0; show_bottom=1; show_strapholder=0; show_grip=0; $(REMOTE_REST)
REMOTE_STRAP:=show_top=0; show_bottom=0; show_strapholder=1; show_grip=0; $(REMOTE_REST)
REMOTE_GRIP:=show_top=0; show_bottom=0; show_strapholder=0; show_grip=1; $(REMOTE_REST)
$(eval $(call build_stl ,remote,$(REMOTE_TOP),top ))
$(eval $(call build_stl ,remote,$(REMOTE_BOTTOM),bottom))
$(foreach a,$(NAMES), $(eval $(call build_stl ,remote,$(REMOTE_STRAP) name=\"$a\",strap_$a)))
$(eval $(call build_stl ,remote,$(REMOTE_GRIP),grip))

8
3d/remote.scad

@ -10,7 +10,7 @@ use <lib/threads.scad>;
$fn=64; $fn=64;
show_top =0; show_top =0;
show_bottom =1;
show_bottom =0;
show_strapholder =0; show_strapholder =0;
show_joysticks =0; show_joysticks =0;
show_grip =0; show_grip =0;
@ -18,7 +18,7 @@ show_grip =0;
enable_text_engrave =0; enable_text_engrave =0;
show_switch =0; show_switch =0;
show_lcd =0;
show_lcd =1;
show_sticks =0; show_sticks =0;
show_stm32 =0; show_stm32 =0;
show_antenna =0; show_antenna =0;
@ -56,7 +56,7 @@ font="Go Mono:style=Bold";
font="Go Mono"; font="Go Mono";
font="Arial Rounded MT Bold:style=Bold"; font="Arial Rounded MT Bold:style=Bold";
font_size=3.75; font_size=3.75;
font_size_name=6.5;
font_size_name=5.5;
font_spaceing=1.25; font_spaceing=1.25;
@ -218,7 +218,7 @@ module strapholder() {
// name // name
translate([0,13,5]) translate([0,13,5])
text_engave(thick,font_size=font_size_name, text_="toolbox v1");
text_engave(thick,font_size=font_size_name, text_=name);
// strap holder // strap holder
translate([0,0,12]) { translate([0,0,12]) {

13
3d/stick.scad

@ -4,10 +4,11 @@
use <lib/cube.scad> use <lib/cube.scad>
use <lib/cylinder.scad> use <lib/cylinder.scad>
is_ps2_stick=0;
// draw itself // draw itself
stick();
stick(10, is_ps2_stick);
module stick(h=10,is_ps2_shaft=1)
module stick(h=10,is_ps2_stick=0)
{ {
$fn=128; $fn=128;
translate([0,0,15-3]) { translate([0,0,15-3]) {
@ -18,7 +19,7 @@ module stick(h=10,is_ps2_shaft=1)
} }
// stick holder with cutout // stick holder with cutout
translate([0,0,0]) { translate([0,0,0]) {
stick_mount(is_ps2_shaft);
stick_mount(is_ps2_stick);
} }
// dust protector // dust protector
@ -67,7 +68,7 @@ module gabber_part() {
} }
} }
module stick_mount(is_ps2_shaft=0) {
module stick_mount(is_ps2_stick=0) {
ps2_dia=4+0.4; ps2_dia=4+0.4;
ps2_width=3+0.4; ps2_width=3+0.4;
@ -82,7 +83,7 @@ module stick_mount(is_ps2_shaft=0) {
translate([0,0,8.5]) translate([0,0,8.5])
cylinder_flange_sphere($fn=32,r2=3, r1=8, h=4.5); cylinder_flange_sphere($fn=32,r2=3, r1=8, h=4.5);
if ( is_ps2_shaft ) {
if ( is_ps2_stick ) {
cylinder(d=6.75,h=10); cylinder(d=6.75,h=10);
} else { } else {
cylinder(d=6,h=10); cylinder(d=6,h=10);
@ -90,7 +91,7 @@ module stick_mount(is_ps2_shaft=0) {
//cylinder(d=15,h=0.1); //cylinder(d=15,h=0.1);
} }
translate([0,0,-eps]) translate([0,0,-eps])
if ( is_ps2_shaft ) {
if ( is_ps2_stick) {
intersection() { intersection() {
cube(center=true,[ps2_width,100,100]); cube(center=true,[ps2_width,100,100]);
cylinder(d=ps2_dia,h=mount_h); cylinder(d=ps2_dia,h=mount_h);

5
remote/include/config.h

@ -16,7 +16,10 @@
#define _CONFIG_H_ #define _CONFIG_H_
#include <stdint.h> #include <stdint.h>
#define REMOE_OWNER "phschoen"
#define REMOE_OWNER "Marleen"
//#define REMOE_OWNER "Sina"
//#define REMOE_OWNER "Malaika"
#define DEFAULT_BIND_TIME 13 /*seconds*/ #define DEFAULT_BIND_TIME 13 /*seconds*/

Loading…
Cancel
Save