Commit all the in-progress stuff for a clean slate

This commit is contained in:
Will Toohey
2020-10-28 18:14:11 +10:00
parent 84101028e2
commit 8b6a304998
30 changed files with 78085 additions and 12575 deletions
-4
View File
@@ -13,11 +13,7 @@ Firmware/LUFA/
Hardware/Project Outputs for SDVX_Mini/
Hardware/Project Logs for SDVX_Mini/
Hardware/SDVX_Mini.PcbDoc.htm
Sales.xlsx
TODO.txt
Hardware/Case/case.scad.*
Costs.xlsx
Hardware/Case/outputs/
Old/
Hardware/datasheets/
Hardware/Case/Laser Templates/
+92 -92
View File
@@ -1,93 +1,93 @@
#ifndef _CONFIG_H
#define _CONFIG_H
#include <stdint.h>
#include <stdbool.h>
#include <LUFA/Drivers/USB/USB.h>
#include "LEDPatterns.h"
#include "Macro.h"
// 7 gameplay switches + macro combo switch
#define SWITCH_COUNT 8
#define JOYSTICK_PPR (24 * 4)
#define MAGIC_RESET_NUMBER 42
// divide by 10 for actual version
#define FIRMWARE_VERSION 15
// increment whenever config structure has breaking changes
#define CONFIG_VERSION 3
// not configurable since they're all the same switches
#define SWITCH_DEBOUNCE 30
typedef enum {
CONTROL_KEYBOARD_MOUSE = 0,
CONTROL_JOYSTICK = 1,
CONTROL_EAC = 2
} control_mode_t;
typedef struct {
// So we can detect and upgrade without losing settings
uint16_t configVersion;
// SWITCH ORDER: START, A-D, FXL-R
uint8_t switches[SWITCH_COUNT];
uint8_t controlMode;
RGB_t btColour;
RGB_t fxColour;
RGB_t breatheColour;
RGB_t knobColours[2];
uint8_t lightsOn;
uint8_t hidLights;
uint8_t keyLights;
uint8_t knobLights;
uint8_t lightPattern;
// When tapping or long-pressing the macro key
Macro_t macroClick;
Macro_t macroHold;
// Reused for both tap or hold, at the end in case I decide to extend
uint8_t macroLen; // placeholder not used yet
uint8_t macroPin[4];
// added in firmware 1.5
uint8_t ledBrightness; // rev6 and up
RGB_t startColour;
} ATTR_PACKED sdvx_config_t;
#define CONFIG_SIZE sizeof(sdvx_config_t)
typedef struct {
uint16_t version;
uint16_t board;
} version_t;
typedef enum {
GETCONFIG = 1,
SETCONFIG = 2,
VERSION = 3, // synced with bootloader, DO NOT CHANGE
DEFAULTCONFIG = 4,
RESET = MAGIC_RESET_NUMBER
} command_action_t;
typedef enum {
RESPOND = 0,
IGNORE,
REBOOT
} command_response_t;
typedef struct {
command_action_t command;
union {
sdvx_config_t config;
version_t version;
} data;
} command_t;
#define COMMAND_BYTES sizeof(command_t)
extern sdvx_config_t sdvxConfig;
extern void InitConfig(void);
extern void SetConfig(sdvx_config_t* config);
void UpdateConfig(void);
extern command_response_t HandleConfig(uint8_t* buffer);
#ifndef _CONFIG_H
#define _CONFIG_H
#include <stdint.h>
#include <stdbool.h>
#include <LUFA/Drivers/USB/USB.h>
#include "LEDPatterns.h"
#include "Macro.h"
// 7 gameplay switches + macro combo switch
#define SWITCH_COUNT 8
#define JOYSTICK_PPR (24 * 4)
#define MAGIC_RESET_NUMBER 42
// divide by 10 for actual version
#define FIRMWARE_VERSION 16
// increment whenever config structure has breaking changes
#define CONFIG_VERSION 3
// not configurable since they're all the same switches
#define SWITCH_DEBOUNCE 30
typedef enum {
CONTROL_KEYBOARD_MOUSE = 0,
CONTROL_JOYSTICK = 1,
CONTROL_EAC = 2
} control_mode_t;
typedef struct {
// So we can detect and upgrade without losing settings
uint16_t configVersion;
// SWITCH ORDER: START, A-D, FXL-R
uint8_t switches[SWITCH_COUNT];
uint8_t controlMode;
RGB_t btColour;
RGB_t fxColour;
RGB_t breatheColour;
RGB_t knobColours[2];
uint8_t lightsOn;
uint8_t hidLights;
uint8_t keyLights;
uint8_t knobLights;
uint8_t lightPattern;
// When tapping or long-pressing the macro key
Macro_t macroClick;
Macro_t macroHold;
// Reused for both tap or hold, at the end in case I decide to extend
uint8_t macroLen; // placeholder not used yet
uint8_t macroPin[4];
// added in firmware 1.5
uint8_t ledBrightness; // rev6 and up
RGB_t startColour;
} ATTR_PACKED sdvx_config_t;
#define CONFIG_SIZE sizeof(sdvx_config_t)
typedef struct {
uint16_t version;
uint16_t board;
} version_t;
typedef enum {
GETCONFIG = 1,
SETCONFIG = 2,
VERSION = 3, // synced with bootloader, DO NOT CHANGE
DEFAULTCONFIG = 4,
RESET = MAGIC_RESET_NUMBER
} command_action_t;
typedef enum {
RESPOND = 0,
IGNORE,
REBOOT
} command_response_t;
typedef struct {
command_action_t command;
union {
sdvx_config_t config;
version_t version;
} data;
} command_t;
#define COMMAND_BYTES sizeof(command_t)
extern sdvx_config_t sdvxConfig;
extern void InitConfig(void);
extern void SetConfig(sdvx_config_t* config);
void UpdateConfig(void);
extern command_response_t HandleConfig(uint8_t* buffer);
#endif
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.
@@ -0,0 +1,139 @@
//Draw text
scale([4,4,4]) drawtext("Hello World!");
//Draw character set
//scale([2,2,2]) drawtext(" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}");
module drawtext(text) {
//Characters
chars = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}";
//Chracter table defining 5x7 characters
//Adapted from: http://www.geocities.com/dinceraydin/djlcdsim/chartable.js
char_table = [ [ 0, 0, 0, 0, 0, 0, 0],
[ 4, 0, 4, 4, 4, 4, 4],
[ 0, 0, 0, 0,10,10,10],
[10,10,31,10,31,10,10],
[ 4,30, 5,14,20,15, 4],
[ 3,19, 8, 4, 2,25,24],
[13,18,21, 8,20,18,12],
[ 0, 0, 0, 0, 8, 4,12],
[ 2, 4, 8, 8, 8, 4, 2],
[ 8, 4, 2, 2, 2, 4, 8],
[ 0, 4,21,14,21, 4, 0],
[ 0, 4, 4,31, 4, 4, 0],
[ 8, 4,12, 0, 0, 0, 0],
[ 0, 0, 0,31, 0, 0, 0],
[12,12, 0, 0, 0, 0, 0],
[ 0,16, 8, 4, 2, 1, 0],
[14,17,25,21,19,17,14],
[14, 4, 4, 4, 4,12, 4],
[31, 8, 4, 2, 1,17,14],
[14,17, 1, 2, 4, 2,31],
[ 2, 2,31,18,10, 6, 2],
[14,17, 1, 1,30,16,31],
[14,17,17,30,16, 8, 6],
[ 8, 8, 8, 4, 2, 1,31],
[14,17,17,14,17,17,14],
[12, 2, 1,15,17,17,14],
[ 0,12,12, 0,12,12, 0],
[ 8, 4,12, 0,12,12, 0],
[ 2, 4, 8,16, 8, 4, 2],
[ 0, 0,31, 0,31, 0, 0],
[16, 8, 4, 2, 4, 8,16],
[ 4, 0, 4, 2, 1,17,14],
[14,21,21,13, 1,17,14],
[17,17,31,17,17,17,14],
[30,17,17,30,17,17,30],
[14,17,16,16,16,17,14],
[30,17,17,17,17,17,30],
[31,16,16,30,16,16,31],
[16,16,16,30,16,16,31],
[15,17,17,23,16,17,14],
[17,17,17,31,17,17,17],
[14, 4, 4, 4, 4, 4,14],
[12,18, 2, 2, 2, 2, 7],
[17,18,20,24,20,18,17],
[31,16,16,16,16,16,16],
[17,17,17,21,21,27,17],
[17,17,19,21,25,17,17],
[14,17,17,17,17,17,14],
[16,16,16,30,17,17,30],
[13,18,21,17,17,17,14],
[17,18,20,30,17,17,30],
[30, 1, 1,14,16,16,15],
[ 4, 4, 4, 4, 4, 4,31],
[14,17,17,17,17,17,17],
[ 4,10,17,17,17,17,17],
[10,21,21,21,17,17,17],
[17,17,10, 4,10,17,17],
[ 4, 4, 4,10,17,17,17],
[31,16, 8, 4, 2, 1,31],
[14, 8, 8, 8, 8, 8,14],
[ 0, 1, 2, 4, 8,16, 0],
[14, 2, 2, 2, 2, 2,14],
[ 0, 0, 0, 0,17,10, 4],
[31, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 2, 4, 8],
[15,17,15, 1,14, 0, 0],
[30,17,17,25,22,16,16],
[14,17,16,16,14, 0, 0],
[15,17,17,19,13, 1, 1],
[14,16,31,17,14, 0, 0],
[ 8, 8, 8,28, 8, 9, 6],
[14, 1,15,17,15, 0, 0],
[17,17,17,25,22,16,16],
[14, 4, 4, 4,12, 0, 4],
[12,18, 2, 2, 2, 6, 2],
[18,20,24,20,18,16,16],
[14, 4, 4, 4, 4, 4,12],
[17,17,21,21,26, 0, 0],
[17,17,17,25,22, 0, 0],
[14,17,17,17,14, 0, 0],
[16,16,30,17,30, 0, 0],
[ 1, 1,15,19,13, 0, 0],
[16,16,16,25,22, 0, 0],
[30, 1,14,16,15, 0, 0],
[ 6, 9, 8, 8,28, 8, 8],
[13,19,17,17,17, 0, 0],
[ 4,10,17,17,17, 0, 0],
[10,21,21,17,17, 0, 0],
[17,10, 4,10,17, 0, 0],
[14, 1,15,17,17, 0, 0],
[31, 8, 4, 2,31, 0, 0],
[ 2, 4, 4, 8, 4, 4, 2],
[ 4, 4, 4, 4, 4, 4, 4],
[ 8, 4, 4, 2, 4, 4, 8] ];
//Binary decode table
dec_table = [ "00000", "00001", "00010", "00011", "00100", "00101",
"00110", "00111", "01000", "01001", "01010", "01011",
"01100", "01101", "01110", "01111", "10000", "10001",
"10010", "10011", "10100", "10101", "10110", "10111",
"11000", "11001", "11010", "11011", "11100", "11101",
"11110", "11111" ];
//Process string one character at a time
for(itext = [0:len(text)-1]) {
//Convert character to index
ichar = search(text[itext],chars,1)[0];
//Decode character - rows
for(irow = [0:6]) {
//Select value to draw from table
val = dec_table[char_table[ichar][irow]];
//Decode character - cols
for(icol = [0:4]) {
// Retrieve bit to draw
bit = search(val[icol],"01",1)[0];
if(bit) {
//Output cube
translate([icol + (6*itext), irow, 0])
cube([1.0001,1.0001,1]);
}
}
}
}
}
@@ -0,0 +1,784 @@
/* This is a first pass at dimension lines for OpenSCAD. The text generated for
* this comes from http://www.thingiverse.com/thing:59817, and I gratefully
* acknowledge user PGreenland for creating this dotmatrix style font.
*
* Download his file first, TextGenerator.scad, before attempting to run this
* program.
*
* What this program does:
*
* This program can draw lines with arrows and has a primitive dimensioning
* element for putting text within arrows. In addition, should the area being
* dimensioned be too narrow, there is a provision for putting the text on
* either side of the arrows.
*
* The dimension lines are drawn on the xy plane and are meant to be seen in a
* top view.
*
* =======================================================
* Be sure to view this from above -- ctrl-4
* =======================================================
*
* Available:
*
* Assorted constants to ease the use of dimensioning line. Because there is
* no introspection regarding the dimensions of your creations, you will want
* to adjust the parameters to fit the context of your creation. You can adjust
* the size of the text, lines, etc to match the rest of your objects.
*
* the following functions or modules are available.
*
* line(length, width, height=DIM_HEIGHT, left_arrow=false, right_arrow=false)
* Can draw a line with the options of including an arrow at either end
*
* circle_center(radius, size, line_width)
* Draws the cross in the center of a circle. There are defaults for the
* cross size and line width
*
* dimensions(length, line_width, loc=DIM_CENTER)
* draws text within lines, such as <--- 3.5 --->
* with the use of the variable loc you can alter the placement of the text
* loc=DIM_CENTER <--- 3.5 ---> this is the default
* loc=DIM_LEFT 3.5 <---->
* loc=DIM_RIGHT <----> 3.5
* loc=DIM_OUTSIDE ---> 3.5 <---
*
* leader_line(angle, radius, angle_length, horz_line_length,
* direction=DIM_RIGHT, line_width, text)
*
* for use in pointing to the edge of a circle and showing text
*
* usage of the leader line:
* translate to the center of the circle
* Typically leader lines have a bend in them. The angle variable is used
* to specify the angle from which the line will point to the center of the
* circle. The radius specifies the location of the arrow. The
* angle_length is distance that the leader line takes until meeting the
* horizontal line. Once the angled line meets the horizontal line, that
* line will either extend to the right or left. direction and therefore
* be either DIM_RIGHT or DIM_LEFT. line_width typically would be whatever
* constant you have selected for all your dimensioned lines. Finally, the
* text will be the value that you wish to show, such as R 0.500.
*
*
* Created by Don Smiley
*/
use <TextGenerator.scad>
// these variables are used within the modules
DIM_CENTER = 0;
DIM_LEFT = 1;
DIM_RIGHT = 2;
DIM_OUTSIDE = 3;
DIM_HORZ = 0;
DIM_VERT = 1;
DIM_UPPER_LEFT = 0;
DIM_UPPER_RIGHT = 1;
DIM_LOWER_LEFT = 2;
DIM_LOWER_RIGHT = 3;
/* Constants related to the annotation lines
*
* Because the dimension of the part to be documented can vary widely, you
* probably are going to need to adjust the parameters to fit the context of
* your part.
*
* For example, the following parameters were used for a part 3.5 units long.
* In addition, DIM_HEIGHT is a height meant to be slightly above your tallest
* part.
*/
DIM_LINE_WIDTH = .025; // width of dimension lines
DIM_SPACE = .1; // a spacing value to make it easier to adjust line spacing etc
DIM_HEIGHT = .01; // height of lines
// refers to the size of the cross within a circle
DIM_HOLE_CENTER = DIM_LINE_WIDTH * 6;
// an approximation that sets the font size relative to the line widths
DIM_FONTSCALE = DIM_LINE_WIDTH * .7;
OFFSET = .05; // added to the hole length to extend past the surface of the cube
module arrow(arr_points, arr_length, height) {
// arrow points to the left
linear_extrude(height=height, convexity=2)
polygon(
points = [[0, 0],
[arr_points, arr_points / 2],
[arr_length, 0],
[arr_points, -arr_points / 2]],
paths = [[0, 1, 2, 3]], convexity = 2);
}
module line(length, width=DIM_LINE_WIDTH,
height=DIM_HEIGHT,
left_arrow=false,
right_arrow=false
) {
/* This module draws a line that can have an arrow on either end. Because
* the intended use is to be viewed strictly from above, the height of the
* line is set arbitrarily thin.
*
* The factors arr_length and arr_points are used to create a proportionate
* arrow. Your sense of asthetics may lead you to choose different
* numbers.
*/
arr_points = width * 4;
arr_length = arr_points * .6;
union() {
if (left_arrow && right_arrow) {
translate([arr_length, -width / 2, 0])
cube([length - arr_length * 2, width, height], center=false);
} else {
if (left_arrow) {
translate([arr_length, -width / 2, 0])
cube([length - arr_length, width, height], center=false);
} else {
if (right_arrow) {
translate([0, -width / 2, 0])
cube([length - arr_length, width, height], center=false);
} else {
translate([0, -width / 2, 0])
cube([length, width, height], center=false);
}
}
}
if (left_arrow) {
arrow(arr_points, arr_length, height);
}
if (right_arrow) {
translate([length, 0, 0])
rotate([0, 0, 180])
arrow(arr_points, arr_length, height);
}
}
}
module circle_center(radius, size=DIM_HOLE_CENTER, line_width=DIM_LINE_WIDTH) {
translate([-size / 2, 0, 0])
line(length=size, width=line_width, height=DIM_HEIGHT, left_arrow=false,
right_arrow=false);
translate([radius - size / 2, 0, 0])
line(length=size, width=line_width, height=DIM_HEIGHT, left_arrow=false,
right_arrow=false);
translate([-radius - size / 2, 0, 0])
line(length=size, width=line_width, height=DIM_HEIGHT, left_arrow=false,
right_arrow=false);
translate([0, -size / 2, 0])
rotate([0, 0, 90])
line(length=size, width=line_width, height=DIM_HEIGHT, left_arrow=false,
right_arrow=false);
translate([0, radius - size / 2, 0])
rotate([0, 0, 90])
line(length=size, width=line_width, height=DIM_HEIGHT, left_arrow=false,
right_arrow=false);
translate([0, -radius - size / 2, 0])
rotate([0, 0, 90])
line(length=size, width=line_width, height=DIM_HEIGHT, left_arrow=false,
right_arrow=false);
}
module dimensions(length, line_width=DIM_LINE_WIDTH, loc=DIM_CENTER) {
text = str(length);
space = len(text) * DIM_FONTSCALE * 7;
if (loc == DIM_CENTER) {
line(length=length / 2 - space / 2, width=line_width, height=DIM_HEIGHT,
left_arrow=true, right_arrow=false);
translate([(length) / 2 - space / 2 * .9, -DIM_FONTSCALE * 3, 0])
scale([DIM_FONTSCALE, DIM_FONTSCALE, DIM_FONTSCALE])
drawtext(text);
translate([length / 2 + space / 2, 0, 0])
line(length=length / 2 - space / 2, width=line_width, height=DIM_HEIGHT,
left_arrow=false, right_arrow=true);
} else {
if (loc == DIM_LEFT) {
line(length=length, width=line_width, height=DIM_HEIGHT,
left_arrow=true, right_arrow=true);
translate([-space, -DIM_FONTSCALE * 3, 0])
scale([DIM_FONTSCALE, DIM_FONTSCALE, DIM_FONTSCALE])
drawtext(text);
} else {
if (loc == DIM_RIGHT) {
line(length=length, width=line_width, height=DIM_HEIGHT,
left_arrow=true, right_arrow=true);
translate([length + space, -DIM_FONTSCALE * 3, 0])
scale([DIM_FONTSCALE, DIM_FONTSCALE, DIM_FONTSCALE])
drawtext(text);
} else {
if (loc == DIM_OUTSIDE) {
rotate([0, 180, 0])
line(length=length / 2, width=line_width, height=DIM_HEIGHT,
left_arrow=true, right_arrow=false);
translate([(length) / 2 - space / 2 * .9,
-DIM_FONTSCALE * 3, 0])
scale([DIM_FONTSCALE, DIM_FONTSCALE, DIM_FONTSCALE])
drawtext(text);
translate([length, 0, 0])
line(length=length / 2, width=line_width, height=DIM_HEIGHT,
left_arrow=true, right_arrow=false);
}
}
}
}
}
module leader_line(angle, radius, angle_length, horz_line_length,
direction=DIM_RIGHT, line_width=DIM_LINE_WIDTH, text, do_circle=false) {
/* leader_line
*
* Creates a line that points directly at a center point from the given
* radius.
* Then, a short horzizontal line is generated, followed by text. The
* direction of the horizontal short line defaults to the right, the
* choice made by either DIM_RIGHT or DIM_LEFT
*/
text_length = len(text) * DIM_FONTSCALE * 6;
space = DIM_FONTSCALE * 6;
rotate([0, 0, angle])
translate([radius, 0, 0])
line(length=angle_length, width=line_width, height=DIM_HEIGHT,
left_arrow=true, right_arrow=false);
rotate([0, 0, angle])
translate([radius + angle_length, 0, 0])
rotate([0, 0, -angle])
union() {
if (direction == DIM_RIGHT) {
line(length=horz_line_length, width=line_width, height=DIM_HEIGHT,
left_arrow=false, right_arrow=false);
translate([(horz_line_length + space), -DIM_FONTSCALE * 3, 0])
scale([DIM_FONTSCALE, DIM_FONTSCALE, DIM_FONTSCALE])
drawtext(text);
if (do_circle) {
translate([(horz_line_length + space + text_length/2),
0, 0])
difference() {
cylinder(h=DIM_HEIGHT, r=text_length + space - line_width,
center=true, $fn=100);
cylinder(h=.05, r=text_length + space - line_width * 2,
center=true, $fn=100);
}
}
} else {
translate([-horz_line_length, 0, 0])
line(length=horz_line_length, width=line_width, height=DIM_HEIGHT,
left_arrow=false, right_arrow=false);
translate([-(horz_line_length + space + text_length),
-DIM_FONTSCALE * 3,
0])
scale([DIM_FONTSCALE, DIM_FONTSCALE, DIM_FONTSCALE])
drawtext(text);
}
}
}
module titleblock(lines, descs, details) {
/* titleblock
*
* This module accepts the following arrays with formats:
*
* holds the description of the lines. width is a factor that
* expands the line width beyond DIM_LINE_WIDTH
*
* lines = [[startx, starty, horz/vert, length, width],
* [startx, starty, horz/vert, length, width]]
*
* holds the descriptions of the title blocks. these are meant to sit in
* the upper left corner. size, like width above, is a factor that
* increases/decreases the size of the font
*
* descs = [[startx, starty, horz/vert, text, size],
* [startx, starty, horz/vert, text, size]]
*
* holds the detail associated with the part being documented
*
* details = [[startx, starty, horz/vert, text, size],
* [startx, starty, horz/vert, text, size]]
*/
DIM_FONTSCALE = DIM_LINE_WIDTH * .7;
for (line = lines) {
translate([line[0] * DIM_LINE_WIDTH,
line[1] * DIM_LINE_WIDTH,
0])
if (line[2] == DIM_VERT) {
rotate([0, 0, -90])
line(length=line[3] * DIM_LINE_WIDTH,
width=DIM_LINE_WIDTH * line[4], height=DIM_HEIGHT,
left_arrow=false, right_arrow=false);
} else {
line(length=(line[3] + 1) * DIM_LINE_WIDTH,
width=DIM_LINE_WIDTH * line[4], height=DIM_HEIGHT,
left_arrow=false, right_arrow=false);
}
}
for (line = descs) {
translate([line[0] * DIM_LINE_WIDTH, line[1] * DIM_LINE_WIDTH, 0])
if (line[2] == DIM_VERT) {
rotate([0, 0, 90])
scale([DIM_FONTSCALE * line[4], DIM_FONTSCALE * line[4],
DIM_FONTSCALE * line[4]])
drawtext(line[3]);
} else {
scale([DIM_FONTSCALE * line[4], DIM_FONTSCALE * line[4],
DIM_FONTSCALE * line[4]])
drawtext(line[3]);
}
}
for (line = details) {
translate([line[0] * DIM_LINE_WIDTH, line[1] * DIM_LINE_WIDTH, 0])
if (line[2] == DIM_VERT) {
rotate([0, 0, 90])
scale([DIM_FONTSCALE * line[4], DIM_FONTSCALE * line[4],
DIM_FONTSCALE * line[4]])
drawtext(line[3]);
} else {
scale([DIM_FONTSCALE * line[4], DIM_FONTSCALE * line[4],
DIM_FONTSCALE * line[4]])
drawtext(line[3]);
}
}
}
module sample_titleblock1() {
/* sample titleblock
*
* Note the use of double thickness lines around the perimeter. Any line
* can be adjusted to be thinner or thicker.
*
* Note also that since lines are centered on their widths, some adjustments
* for half-width spacing is needed to avoid a jagged look on corners.
* You can see that in the horizontal lines in the first section that are
* offset by 1, which is the half-width of the outside line.
*/
title_width = 290;
row_height = 15;
cols = [-1, 50, 114, 200, 215, 260];
rows = [0, -row_height, -row_height * 2, -row_height * 3, -row_height * 4];
// spacing tweaks to fit into the blocks
desc_x = 2; // column offset for start of small text
desc_y = -5; // row offset for start of small text
det_y = -12; // row offset for start of detail text
desc_size = .75; // relative size of description text
lines = [
// horizontal lines
[cols[0], rows[0], DIM_HORZ, title_width, 2],
[cols[0], rows[1], DIM_HORZ, title_width, 1],
[cols[2], rows[2], DIM_HORZ, title_width - cols[2] - 1, 1],
[cols[3], rows[3], DIM_HORZ, title_width - cols[3] - 1, 1],
[cols[0], rows[4] - 1, DIM_HORZ, title_width, 2],
// vertical lines
[0, 0, DIM_VERT, row_height * 4, 2],
[cols[1], rows[0], DIM_VERT, row_height, 1],
[cols[2], rows[0], DIM_VERT, row_height * 4, 1],
[cols[3], rows[0], DIM_VERT, row_height * 4, 1],
[cols[4], rows[3], DIM_VERT, row_height, 1],
[cols[5], rows[3], DIM_VERT, row_height, 1],
[title_width - 1, 0, DIM_VERT, row_height * 4, 2],
];
descs = [
[cols[0] + desc_x, rows[0] + desc_y, DIM_HORZ,
"Responsible dep", desc_size],
[cols[1] + desc_x, rows[0] + desc_y, DIM_HORZ,
"Technical reference", desc_size],
[cols[2] + desc_x, rows[0] + desc_y, DIM_HORZ,
"Creator", desc_size],
[cols[3] + desc_x, rows[0] + desc_y, DIM_HORZ,
"Approval person", desc_size],
[cols[2] + desc_x, rows[1] + desc_y, DIM_HORZ,
"Document type", desc_size],
[cols[3] + desc_x, rows[1] + desc_y, DIM_HORZ,
"Document status", desc_size],
[cols[2] + desc_x, rows[2] + desc_y, DIM_HORZ,
"Title", desc_size],
[cols[3] + desc_x, rows[2] + desc_y, DIM_HORZ,
"Identification number", desc_size],
[cols[3] + desc_x, rows[3] + desc_y, DIM_HORZ,
"Rev", desc_size],
[cols[4] + desc_x, rows[3] + desc_y, DIM_HORZ,
"Date of issue", desc_size],
[cols[5] + desc_x, rows[3] + desc_y, DIM_HORZ,
"Sheet", desc_size]
];
details = [
[cols[0] + desc_x, rows[0] + det_y, DIM_HORZ,
" ", 1], //Responsible dep.
[cols[1] + desc_x, rows[0] + det_y, DIM_HORZ,
" ", 1], //Technical reference
[cols[2] + desc_x, rows[0] + det_y, DIM_HORZ,
"D. Smiley ", 1], //Creator
[cols[3] + desc_x, rows[0] + det_y, DIM_HORZ,
" ", 1], //Approval person
[cols[0] + desc_x + 10, rows[2] + det_y, DIM_HORZ,
"My OpenSCAD Project", 1],
[cols[2] + desc_x, rows[1] + det_y, DIM_HORZ,
" ", 1], //Document type
[cols[3] + desc_x, rows[1] + det_y, DIM_HORZ,
"First issue", 1], //Document status
[cols[2] + desc_x, rows[2] + det_y, DIM_HORZ,
"Sample Part", 1], //Title
[cols[3] + desc_x, rows[2] + det_y, DIM_HORZ,
"123", 1], //Identification number
[cols[3] + desc_x, rows[3] + det_y, DIM_HORZ,
" ", 1], //Rev
[cols[4] + desc_x, rows[3] + det_y, DIM_HORZ,
"2013-3-31", 1], //Date of issue
[cols[5] + desc_x, rows[3] + det_y, DIM_HORZ,
"1/100", 1] //Sheet
];
titleblock(lines, descs, details);
}
module sample_revisionblock(revisions) {
DIM_FONTSCALE = DIM_LINE_WIDTH * .7;
// revision block headings
row_height = 15;
revision_width = 100;
desc_x = 2;
desc_y = -10;
desc_size = 1;
cols = [0, 20, 60, revision_width];
rows = [0, -row_height, -row_height * 2];
// draw
lines = [
// horizontal lines
[cols[0], rows[0], DIM_HORZ, revision_width, 1],
[cols[0], rows[1], DIM_HORZ, revision_width, 1],
[cols[0], rows[2], DIM_HORZ, revision_width, 1],
// vertical lines
[cols[0], rows[0], DIM_VERT, row_height * 2, 1],
[cols[1], rows[0], DIM_VERT, row_height, 1],
[cols[2], rows[0], DIM_VERT, row_height, 1],
[cols[3], rows[0], DIM_VERT, row_height * 2, 1],
];
descs = [
[cols[0] + desc_x, rows[0] + desc_y, DIM_HORZ,
"Rev.", desc_size],
[cols[1] + desc_x, rows[0] + desc_y, DIM_HORZ,
"Date", desc_size],
[cols[2] + desc_x, rows[0] + desc_y, DIM_HORZ,
"Initials", desc_size],
[cols[1] + desc_x, rows[1] + desc_y, DIM_HORZ,
"Revisions", desc_size],
];
details = [];
num_revisions = len(revisions);
translate([-(revision_width + 40) * DIM_LINE_WIDTH,
row_height * 2 * DIM_LINE_WIDTH, 0])
union() {
titleblock(lines, descs, details);
// now for the start of actual revisions
// do this piecemeal -- draw the vertical first
for (col = [0: len(cols)]) {
translate([cols[col] * DIM_LINE_WIDTH, 0, 0])
rotate([0, 0, 90])
line(num_revisions * row_height * DIM_LINE_WIDTH);
}
for (row = [0: len(revisions)]) {
translate([0, row * row_height * DIM_LINE_WIDTH, 0])
line(revision_width * DIM_LINE_WIDTH);
for (col = [0:2]) {
translate([(cols[col] + desc_x) * DIM_LINE_WIDTH,
((row + 1) * row_height + desc_y) * DIM_LINE_WIDTH, 0])
scale([DIM_FONTSCALE, DIM_FONTSCALE, DIM_FONTSCALE])
drawtext(revisions[row][col]);
}
}
}
}
module sample_titleblock2() {
row_height = 20;
cols = [-.5, 100, 154, 270];
title_width = cols[3];
rows = [0, -row_height, -row_height * 2, -row_height * 3, -row_height * 4,
-row_height * 5, -row_height * 6, -row_height * 7
];
// spacing tweaks to fit into the blocks
desc_x = 2; // column offset for start of small text
desc_y = -5; // row offset for start of small text
det_x = 15; // col offset for start of detail text
det_y = -15; // row offset for start of detail text
desc_size = .75; // relative size of description text
lines = [
// horizontal lines
[-.5, 0, DIM_HORZ, title_width, 1],
[cols[2], rows[1], DIM_HORZ, cols[3] - cols[2] - .5, 1],
[cols[0], rows[2], DIM_HORZ, cols[1] - cols[0] - .5, 1],
[cols[0], rows[3], DIM_HORZ, cols[3] - .5, 1],
[cols[0], rows[4], DIM_HORZ, cols[2] - .5, 1],
[cols[0], rows[5], DIM_HORZ, cols[3] - .5, 1],
[cols[0], rows[6], DIM_HORZ, cols[2] - .5, 1],
[cols[0], rows[7], DIM_HORZ, cols[2] - .5, 1],
[cols[0], rows[7], DIM_HORZ, title_width, 1],
// vertical lines
[cols[0], rows[0], DIM_VERT, -rows[7], 1],
[cols[1], rows[0], DIM_VERT, -rows[7], 1],
[cols[2], rows[0], DIM_VERT, -rows[7], 1],
[cols[3], rows[0], DIM_VERT, -rows[7], 1],
];
part_desc = ["Material", "Finish", "Weight", "Part No."];
doc_desc = ["Drawing Number",
"Created by",
"Reviewed by",
"Date of issue"
];
// aspects of the part
part_details = [
"My Sample Part", // title
"Stainless Steel", // material
" ", // finish
"2.5", // weight
"123", // part no
];
// aspects documenting the creation of the part
doc_details = [
"33-2", // Drawing No.
"D. Smiley", // Created by
" ", // Reviewd by
"2013-3-31", // Date
];
// the organization making the part
org_details = [
"My logo",
"Canny Machines",
"Org Address, phone"
];
descs = [
// part description
[cols[0] + desc_x, rows[2] + desc_y, DIM_HORZ, part_desc[0], desc_size],
[cols[0] + desc_x, rows[3] + desc_y, DIM_HORZ, part_desc[1], desc_size],
[cols[0] + desc_x, rows[4] + desc_y, DIM_HORZ, part_desc[2], desc_size],
[cols[0] + desc_x, rows[5] + desc_y, DIM_HORZ, part_desc[3], desc_size],
// documentation description
[cols[1] + desc_x, rows[3] + desc_y, DIM_HORZ, doc_desc[0], desc_size],
[cols[1] + desc_x, rows[4] + desc_y, DIM_HORZ, doc_desc[1], desc_size],
[cols[1] + desc_x, rows[5] + desc_y, DIM_HORZ, doc_desc[2], desc_size],
[cols[1] + desc_x, rows[6] + desc_y, DIM_HORZ, doc_desc[3], desc_size],
];
details = [
[cols[0] + desc_x, rows[0] + det_y, DIM_HORZ, part_details[0], 1.5],
[cols[0] + desc_x, rows[2] + det_y, DIM_HORZ, part_details[1], 1],
[cols[0] + desc_x, rows[3] + det_y, DIM_HORZ, part_details[2], 1],
[cols[0] + desc_x, rows[4] + det_y, DIM_HORZ, part_details[3], 1],
[cols[0] + desc_x, rows[5] + det_y, DIM_HORZ, part_details[4], 1],
[cols[1] + desc_x * 2, rows[3] + det_y, DIM_HORZ, doc_details[0], 1],
[cols[1] + desc_x * 2, rows[4] + det_y, DIM_HORZ, doc_details[1], 1],
[cols[1] + desc_x * 2, rows[5] + det_y, DIM_HORZ, doc_details[2], 1],
[cols[1] + desc_x * 2, rows[6] + det_y, DIM_HORZ, doc_details[3], 1],
// Organization Details
[cols[1] + desc_x, rows[1] + det_y, DIM_HORZ, org_details[0], 1.5],
[cols[2] + desc_x, rows[0] + det_y, DIM_HORZ, org_details[1], 1.5],
[cols[2] + desc_x, rows[1] + det_y, DIM_HORZ, org_details[2], 1],
];
titleblock(lines, descs, details);
revisions = [
["1a", "2013-4-1", "ds"],
["1b", "2013-4-2", "ds"],
["2a", "2013-4-3", "ds"],
["3a", "2013-4-5", "ds"],
["4a", "2013-4-15", "ds"],
];
rotate([0, 0, 90])
sample_revisionblock(revisions);
}
module sample_lines(){
// sample lines
union() {
line(length=2, width=DIM_LINE_WIDTH, height=DIM_HEIGHT,
left_arrow=false, right_arrow=false);
translate([0, -0.25, 0])
line(length=2, width=DIM_LINE_WIDTH, height=DIM_HEIGHT, left_arrow=true,
right_arrow=false);
translate([0, -0.5, 0])
line(length=2, width=DIM_LINE_WIDTH, height=DIM_HEIGHT,
left_arrow=false, right_arrow=true);
translate([0, -0.75, 0])
line(length=2, width=DIM_LINE_WIDTH, height=DIM_HEIGHT, left_arrow=true,
right_arrow=true);
}
}
module sample_dimensions() {
/* shows all possibilities
DIM_CENTER = 0;
DIM_LEFT = 1;
DIM_RIGHT = 2;
DIM_OUTSIDE = 3;
*/
length = 2.5;
// The following two lines are vertical lines that bracket the dimensions
// left arrow
translate([0, -1.75, 0])
rotate([0, 0, 90])
line(length=length, width=DIM_LINE_WIDTH, height=DIM_HEIGHT,
left_arrow=false, right_arrow=false);
// right arrow
translate([length, -1.75, 0])
rotate([0, 0, 90])
line(length=length, width=DIM_LINE_WIDTH, height=DIM_HEIGHT,
left_arrow=false, right_arrow=false);
// The following runs through all the dimension types
for (i = [0:4]) {
translate([0, -.5 * i, 0])
dimensions(length=length, line_width=DIM_LINE_WIDTH, loc=i);
}
}
module sample_leaderlines() {
radius = .25;
for (i = [0:6]) {
leader_line(angle=i * 15, radius=.25, angle_length=(i * .25),
horz_line_length=.5, direction=DIM_RIGHT,
line_width=DIM_LINE_WIDTH,
text=str("leader line angle: ", i * 15 + 90),
do_circle=false
);
}
for (i = [1:7]) {
leader_line(angle=i * 20 + 90, radius=.25,
angle_length=.75,
horz_line_length=.5, direction=DIM_LEFT,
line_width=DIM_LINE_WIDTH,
text=str("leader line angle: ", i * 20 + 90));
}
for (i = [1:4]) {
leader_line(angle=-i * 20, radius=.25, angle_length=1.5,
horz_line_length=.25, direction=DIM_RIGHT,
line_width=DIM_LINE_WIDTH,
text=str(i),
do_circle=true
);
}
}
module sample_circlecenter() {
radius = .25;
difference() {
cube([1, 1, 1], center=true);
cylinder(h=1.1, r=radius, center=true, $fn=100);
}
color("Black")
translate([0, 0, .51])
circle_center(radius=radius, size=DIM_HOLE_CENTER,
line_width=DIM_LINE_WIDTH);
}
// uncomment these to sample
// sample_lines();
//
// translate([-5.5, 0, 0])
// sample_dimensions();
//
// translate([4, 0, 0])
// sample_circlecenter();
//
// translate([-2, 3, 0])
// sample_leaderlines();
//
// translate([3, 4, 0])
// sample_titleblock1();
//
// translate([0, -2, 0])
// sample_titleblock2();
+142
View File
@@ -0,0 +1,142 @@
include <imports/dimlines.scad>
use <utils.scad>
$fn = 128;
// 0.2 a little less for tight hold
encoder = [16+0.2, 16, 6.5 - 0.2];
encoder_diam = 26;
side_cut = 0;
side_cut_height = 1.5;
side_cut_flat = 0.5;
hole_cut = 9.3;
material_thick = 0.8;
wing_rounding = 2;
hole_size = 2.1;
hole_clearance = 1.5;
hole_offset = [2.75+0.3,0,0];
wing_length = encoder.x*2; // will be trimmed
DIM_LINE_WIDTH = 0.17;
DIM_FONTSCALE = DIM_LINE_WIDTH * 0.4;
echo(wing_length);
module encoder_model() {
translate([0,0,5.5])
rotate([90,0,0])
import("imports/PEC16.stl");
// Shaft
encoder_shaft = 6;
encoder_flat = 4.5;
translate([0,0,6.5])
linear_extrude(20)
intersection() {
circle(d = encoder_shaft);
translate([0, (encoder_shaft-encoder_flat)/2])
square([encoder_shaft, encoder_flat], center = true);
}
}
module xycube(dims) {
translate([0,0,dims.z/2])
cube(dims, center=true);
}
module main_bit() {
intersection() {
difference() {
union() {
xycube(encoder + [material_thick*2, 0, material_thick]);
//color("green")
xycube([
wing_length*2 + encoder.x + material_thick*2,
encoder.y,
material_thick
]);
}
// offsets are for nice f5 render
translate([0,0,-1])
xycube(encoder + [0,1,1]);
// cutouts
translate([0,0,-0.1])
xycube([
encoder.x+side_cut_flat*2+material_thick*2,
side_cut,
side_cut_height-0.1]);
cylinder(d=hole_cut, h=encoder.z*2);
screw_off = [
hole_offset.x + encoder.x/2 - 0.2,
hole_offset.y,
0
];
echo("Screw offset from center", screw_off);
// screws
reflect([1,0,0])
reflect([0,1,0])
translate(screw_off + [0,0,-0.1])
cylinder(d = hole_size, h = material_thick*2);
reflect([1,0,0])
reflect([0,1,0])
translate(screw_off + [0,0,material_thick])
#cylinder(d = 3.8, h = material_thick*2);
}
cylinder(d = encoder_diam, h = encoder.z*2);
}
}
module dims() {
translate([-encoder.x/2,-encoder.y/2,0])
rotate([90,0,0])
dimensions(encoder.x);
translate([encoder.x/4,-encoder.y/2,encoder.z])
rotate([90,90,0])
dimensions(encoder.z);
translate([encoder.x/2+material_thick,-encoder.y/2,6])
rotate([90,0,90])
dimensions(encoder.y);
translate([encoder.x/2+material_thick,-side_cut/2,1.5])
rotate([90,0,90])
dimensions(side_cut);
translate([encoder.x/2+material_thick,side_cut/2+0.5,side_cut_height])
rotate([90,90,90])
dimensions(side_cut_height);
translate([-hole_cut/2,0,encoder.z+material_thick])
dimensions(hole_cut);
leader_line(25, encoder_diam/2, 5, 5, text = str(encoder_diam), do_circle=true);
screw_off = [
hole_offset.x + encoder.x/2 + material_thick,
hole_offset.y,
0
];
translate(screw_off + [0,0,material_thick])
leader_line(25, hole_size/2, 5, 4, text = str(hole_size), do_circle=true);
translate([encoder.x/2 + material_thick,2,material_thick+encoder.z+0.1])
dimensions(side_cut_flat, loc = DIM_OUTSIDE);
}
//color("gray")
//encoder_model();
//color("black")
//dims();
main_bit();
Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

+16
View File
@@ -0,0 +1,16 @@
// like mirror, but leaves the original too
module reflect(axis) {
children();
mirror(axis)
children();
}
module rounded_square(w, h, r, center=false) {
translate([r,r] - (center ? [w/2,h/2] : [0,0]))
minkowski() {
square([w,h]-[r*2,r*2]);
circle(r=r);
}
}
Binary file not shown.
+11611 -11202
View File
File diff suppressed because it is too large Load Diff
@@ -1,32 +1,32 @@
(module Encoder_Bourns_PEC16 (layer F.Cu) (tedit 5AF0166B)
(fp_text reference REF** (at 0 -5.08) (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value Encoder_Bourns_PEC16 (at 0 3.81) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_line (start -8 10.5) (end -8 2.5) (layer F.SilkS) (width 0.3))
(fp_line (start -6.5 10.5) (end -8 10.5) (layer F.SilkS) (width 0.3))
(fp_line (start -1.5 10.5) (end -3.5 10.5) (layer F.SilkS) (width 0.3))
(fp_line (start 3.5 10.5) (end 1.5 10.5) (layer F.SilkS) (width 0.3))
(fp_line (start 8 10.5) (end 6.5 10.5) (layer F.SilkS) (width 0.3))
(fp_line (start 8 2.5) (end 8 10.5) (layer F.SilkS) (width 0.3))
(fp_line (start 8 -7) (end 8 -2.5) (layer F.SilkS) (width 0.3))
(fp_line (start -8 -7) (end 8 -7) (layer F.SilkS) (width 0.3))
(fp_line (start -8 -2.5) (end -8 -7) (layer F.SilkS) (width 0.3))
(fp_line (start -10.2 12.4) (end 10.2 12.4) (layer F.CrtYd) (width 0.3))
(fp_line (start -10.2 -8.4) (end -10.2 12.4) (layer F.CrtYd) (width 0.3))
(fp_line (start 10.2 -8.4) (end -10.2 -8.4) (layer F.CrtYd) (width 0.3))
(fp_line (start 10.2 12.4) (end 10.2 -8.4) (layer F.CrtYd) (width 0.3))
(fp_circle (center 0 0) (end -1 -1) (layer F.SilkS) (width 0.3))
(pad 1 thru_hole circle (at -5 10.5) (size 1.6 1.6) (drill 1.2) (layers *.Cu *.Mask))
(pad 2 thru_hole circle (at 5 10.5) (size 1.6 1.6) (drill 1.2) (layers *.Cu *.Mask))
(pad 3 thru_hole circle (at 0 10.5) (size 1.6 1.6) (drill 1.2) (layers *.Cu *.Mask))
(pad "" thru_hole oval (at 8 0) (size 3.8 3.4) (drill oval 2.8 2.4) (layers *.Cu *.Mask))
(pad "" thru_hole oval (at -8 0) (size 3.8 3.4) (drill oval 2.8 2.4) (layers *.Cu *.Mask))
(model ${KIPRJMOD}/PocketVoltex.pretty/PEC16-4X20F-SXXXX_sp.wrl
(at (xyz 0 0 0))
(scale (xyz 1 1 1))
(rotate (xyz 0 0 0))
)
)
(module Encoder_Bourns_PEC16 (layer F.Cu) (tedit 5D21E9FA)
(fp_text reference REF** (at 0 -5.08) (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value Encoder_Bourns_PEC16 (at 0 3.81) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_line (start -8 10.5) (end -8 2.5) (layer F.SilkS) (width 0.3))
(fp_line (start -6.5 10.5) (end -8 10.5) (layer F.SilkS) (width 0.3))
(fp_line (start -1.5 10.5) (end -3.5 10.5) (layer F.SilkS) (width 0.3))
(fp_line (start 3.5 10.5) (end 1.5 10.5) (layer F.SilkS) (width 0.3))
(fp_line (start 8 10.5) (end 6.5 10.5) (layer F.SilkS) (width 0.3))
(fp_line (start 8 2.5) (end 8 10.5) (layer F.SilkS) (width 0.3))
(fp_line (start 8 -7) (end 8 -2.5) (layer F.SilkS) (width 0.3))
(fp_line (start -8 -7) (end 8 -7) (layer F.SilkS) (width 0.3))
(fp_line (start -8 -2.5) (end -8 -7) (layer F.SilkS) (width 0.3))
(fp_line (start -10.2 12.4) (end 10.2 12.4) (layer F.CrtYd) (width 0.3))
(fp_line (start -10.2 -8.4) (end -10.2 12.4) (layer F.CrtYd) (width 0.3))
(fp_line (start 10.2 -8.4) (end -10.2 -8.4) (layer F.CrtYd) (width 0.3))
(fp_line (start 10.2 12.4) (end 10.2 -8.4) (layer F.CrtYd) (width 0.3))
(fp_circle (center 0 0) (end -1 -1) (layer F.SilkS) (width 0.3))
(pad A thru_hole circle (at -5 10.5) (size 1.6 1.6) (drill 1.2) (layers *.Cu *.Mask))
(pad C thru_hole circle (at 5 10.5) (size 1.6 1.6) (drill 1.2) (layers *.Cu *.Mask))
(pad B thru_hole circle (at 0 10.5) (size 1.6 1.6) (drill 1.2) (layers *.Cu *.Mask))
(pad "" thru_hole oval (at 8 0) (size 3.8 3.4) (drill oval 2.8 2.4) (layers *.Cu *.Mask))
(pad "" thru_hole oval (at -8 0) (size 3.8 3.4) (drill oval 2.8 2.4) (layers *.Cu *.Mask))
(model ${KIPRJMOD}/PocketVoltex.pretty/PEC16-4X20F-SXXXX_sp.wrl
(at (xyz 0 0 0))
(scale (xyz 1 1 1))
(rotate (xyz 0 0 0))
)
)
@@ -0,0 +1,37 @@
(module Encoder_Bourns_PEC16_hotswap (layer F.Cu) (tedit 5E96D693)
(fp_text reference REF** (at 0 -5.08) (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value Encoder_Bourns_PEC16 (at 0 3.81) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_line (start -8 10.5) (end -8 2.5) (layer F.SilkS) (width 0.3))
(fp_line (start -6.5 10.5) (end -8 10.5) (layer F.SilkS) (width 0.3))
(fp_line (start -1.5 10.5) (end -3.5 10.5) (layer F.SilkS) (width 0.3))
(fp_line (start 3.5 10.5) (end 1.5 10.5) (layer F.SilkS) (width 0.3))
(fp_line (start 8 10.5) (end 6.5 10.5) (layer F.SilkS) (width 0.3))
(fp_line (start 8 2.5) (end 8 10.5) (layer F.SilkS) (width 0.3))
(fp_line (start 8 -7) (end 8 -2.5) (layer F.SilkS) (width 0.3))
(fp_line (start -8 -7) (end 8 -7) (layer F.SilkS) (width 0.3))
(fp_line (start -8 -2.5) (end -8 -7) (layer F.SilkS) (width 0.3))
(fp_line (start -10.2 12.4) (end 10.2 12.4) (layer F.CrtYd) (width 0.3))
(fp_line (start -10.2 -8.4) (end -10.2 12.4) (layer F.CrtYd) (width 0.3))
(fp_line (start 10.2 -8.4) (end -10.2 -8.4) (layer F.CrtYd) (width 0.3))
(fp_line (start 10.2 12.4) (end 10.2 -8.4) (layer F.CrtYd) (width 0.3))
(fp_circle (center 0 0) (end -1 -1) (layer F.SilkS) (width 0.3))
(fp_circle (center 11.25 0) (end 14.25 0) (layer Dwgs.User) (width 0.12))
(fp_circle (center -11.25 0) (end -8.25 0) (layer Dwgs.User) (width 0.12))
(fp_circle (center -5 10.5) (end -3.1 10.5) (layer Dwgs.User) (width 0.12))
(fp_circle (center 0 10.5) (end 1.9 10.5) (layer Dwgs.User) (width 0.12))
(fp_circle (center 5 10.5) (end 6.9 10.5) (layer Dwgs.User) (width 0.12))
(pad "" np_thru_hole oval (at 8 0) (size 2.8 2.4) (drill oval 2.8 2.4) (layers *.Cu *.Mask))
(pad "" np_thru_hole oval (at -8 0) (size 2.8 2.4) (drill oval 2.8 2.4) (layers *.Cu *.Mask))
(pad A smd rect (at -5 10.5 90) (size 5.75 2) (layers F.Cu F.Paste F.Mask))
(pad B smd rect (at 0 10.5 90) (size 5.75 2) (layers F.Cu F.Paste F.Mask))
(pad C smd rect (at 5 10.5 90) (size 5.75 2) (layers F.Cu F.Paste F.Mask))
(model ${KIPRJMOD}/Encoder.pretty/PEC16-4X20F-SXXXX_sp.wrl
(at (xyz 0 0 0))
(scale (xyz 1 1 1))
(rotate (xyz 0 0 0))
)
)
@@ -0,0 +1,15 @@
(module Harwin-SMD-Socket-S9091-46R (layer F.Cu) (tedit 5E96D20A)
(fp_text reference REF** (at 0 -3.7) (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value Harwin-SMD-Socket-S9091-46R (at 0 3.6) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(pad 1 smd rect (at 0 0 90) (size 5.75 2) (layers F.Cu F.Paste F.Mask))
(pad "" np_thru_hole circle (at 0 0) (size 3.8 3.8) (drill 3.8) (layers *.Cu *.Mask))
(model ${KIPRJMOD}/PocketVoltex.pretty/Harwin-s9091-46r.stp
(offset (xyz 0 0 0.2))
(scale (xyz 1 1 1))
(rotate (xyz 180 0 90))
)
)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,31 @@
(module SMD_Standoff_M2_Wurth (layer F.Cu) (tedit 5E96DE41)
(fp_text reference REF** (at 0 4) (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value SMD_Standoff_M2_Wurth (at 0 -2) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_circle (center 0 0) (end 2.075 0) (layer F.Cu) (width 1.15))
(fp_circle (center 0 0) (end 2.075 0) (layer F.Mask) (width 1.15))
(fp_arc (start 0 0) (end 1.9 -0.9) (angle -39.3) (layer F.Paste) (width 1.15))
(fp_poly (pts (xy 0.6 -2.53) (xy 0.96 -2.43) (xy 0.65 -1.43) (xy 0.21 -1.51)
(xy 0.21 -2.59)) (layer F.Paste) (width 0.1))
(fp_poly (pts (xy 2.54 -0.58) (xy 2.59 -0.25) (xy 1.52 -0.25) (xy 1.43 -0.68)
(xy 2.41 -1.04)) (layer F.Paste) (width 0.1))
(fp_arc (start 0 0) (end -0.9 -1.9) (angle -39.3) (layer F.Paste) (width 1.15))
(fp_poly (pts (xy -0.58 -2.54) (xy -0.25 -2.59) (xy -0.25 -1.52) (xy -0.68 -1.43)
(xy -1.04 -2.41)) (layer F.Paste) (width 0.1))
(fp_poly (pts (xy -2.53 -0.6) (xy -2.43 -0.96) (xy -1.43 -0.65) (xy -1.51 -0.21)
(xy -2.59 -0.21)) (layer F.Paste) (width 0.1))
(fp_arc (start 0 0) (end -1.9 0.9) (angle -39.3) (layer F.Paste) (width 1.15))
(fp_poly (pts (xy -2.54 0.58) (xy -2.59 0.25) (xy -1.52 0.25) (xy -1.43 0.68)
(xy -2.41 1.04)) (layer F.Paste) (width 0.1))
(fp_poly (pts (xy -0.6 2.53) (xy -0.96 2.43) (xy -0.65 1.43) (xy -0.21 1.51)
(xy -0.21 2.59)) (layer F.Paste) (width 0.1))
(fp_arc (start 0 0) (end 0.9 1.9) (angle -39.3) (layer F.Paste) (width 1.15))
(fp_poly (pts (xy 0.58 2.54) (xy 0.25 2.59) (xy 0.25 1.52) (xy 0.68 1.43)
(xy 1.04 2.41)) (layer F.Paste) (width 0.1))
(fp_poly (pts (xy 2.53 0.6) (xy 2.43 0.96) (xy 1.43 0.65) (xy 1.51 0.21)
(xy 2.59 0.21)) (layer F.Paste) (width 0.1))
(pad "" np_thru_hole circle (at 0 0) (size 3 3) (drill 3) (layers *.Cu *.Mask))
)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,56 @@
(module USB_C_Receptacle_GCT_USB4085 (layer F.Cu) (tedit 5D21F424)
(descr "USB 2.0 Type C Receptacle, https://gct.co/Files/Drawings/USB4085.pdf")
(tags "USB Type-C Receptacle Through-hole Right angle")
(fp_text reference REF** (at 2.975 -1.8) (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value USB_C_Receptacle_GCT_USB4085 (at 2.975 9.925) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_line (start -1.5 -0.56) (end 7.45 -0.56) (layer F.Fab) (width 0.1))
(fp_line (start -1.5 8.61) (end 7.45 8.61) (layer F.Fab) (width 0.1))
(fp_line (start -1.62 8.73) (end 7.57 8.73) (layer F.SilkS) (width 0.12))
(fp_line (start -1.5 -0.68) (end 7.45 -0.68) (layer F.SilkS) (width 0.12))
(fp_line (start -1.5 -0.56) (end -1.5 8.61) (layer F.Fab) (width 0.1))
(fp_line (start 7.45 -0.56) (end 7.45 8.61) (layer F.Fab) (width 0.1))
(fp_line (start 7.57 6) (end 7.57 8.73) (layer F.SilkS) (width 0.12))
(fp_line (start -1.62 6) (end -1.62 8.73) (layer F.SilkS) (width 0.12))
(fp_line (start 7.57 2.4) (end 7.57 3.3) (layer F.SilkS) (width 0.12))
(fp_line (start -1.62 2.4) (end -1.62 3.3) (layer F.SilkS) (width 0.12))
(fp_line (start -2.3 -1.06) (end -2.3 9.11) (layer F.CrtYd) (width 0.05))
(fp_line (start -2.3 9.11) (end 8.25 9.11) (layer F.CrtYd) (width 0.05))
(fp_line (start -2.3 -1.06) (end 8.25 -1.06) (layer F.CrtYd) (width 0.05))
(fp_line (start 8.25 -1.06) (end 8.25 9.11) (layer F.CrtYd) (width 0.05))
(fp_line (start -0.025 6.1) (end 5.975 6.1) (layer F.Fab) (width 0.1))
(fp_text user "PCB Edge" (at 2.975 6.1) (layer Dwgs.User)
(effects (font (size 0.5 0.5) (thickness 0.1)))
)
(fp_text user %R (at 2.975 4.025) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(pad A1 thru_hole circle (at 0 0) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask))
(pad A4 thru_hole circle (at 0.85 0) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask))
(pad A5 thru_hole circle (at 1.7 0) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask))
(pad A6 thru_hole circle (at 2.55 0) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask))
(pad A7 thru_hole circle (at 3.4 0) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask))
(pad A8 thru_hole circle (at 4.25 0) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask))
(pad A9 thru_hole circle (at 5.1 0) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask))
(pad A12 thru_hole circle (at 5.95 0) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask))
(pad B9 thru_hole circle (at 0.85 1.35) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask))
(pad B7 thru_hole circle (at 2.55 1.35) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask))
(pad B8 thru_hole circle (at 1.7 1.35) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask))
(pad B12 thru_hole circle (at 0 1.35) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask))
(pad B5 thru_hole circle (at 4.25 1.35) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask))
(pad B4 thru_hole circle (at 5.1 1.35) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask))
(pad B1 thru_hole circle (at 5.95 1.35) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask))
(pad B6 thru_hole circle (at 3.4 1.35) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask))
(pad S1 thru_hole oval (at -1.35 0.98) (size 0.9 2.4) (drill oval 0.6 2.1) (layers *.Cu *.Mask))
(pad S1 thru_hole oval (at 7.3 0.98) (size 0.9 2.4) (drill oval 0.6 2.1) (layers *.Cu *.Mask))
(pad S1 thru_hole oval (at -1.35 4.36) (size 0.9 1.7) (drill oval 0.6 1.4) (layers *.Cu *.Mask))
(pad S1 thru_hole oval (at 7.3 4.36) (size 0.9 1.7) (drill oval 0.6 1.4) (layers *.Cu *.Mask))
(model ${KIPRJMOD}/PocketVoltex.pretty/USB4085-GF-A-fixed.stp
(offset (xyz -0.275 3 -4.89))
(scale (xyz 1 1 1))
(rotate (xyz -90 0 0))
)
)
+1440 -1227
View File
File diff suppressed because it is too large Load Diff
+141
View File
@@ -0,0 +1,141 @@
31108077063332
Pocket Voltex
Cherry-MX-Kailh-only
0
2
2
Pocket Voltex
Encoder_Bourns_PEC16
0
5
3
Pocket Voltex
Encoder_Bourns_PEC16_hotswap
0
3
3
Pocket Voltex
Harwin-SMD-Socket-S9091-46R
0
1
1
Pocket Voltex
LED_SK9822
http://cdn.sparkfun.com/datasheets/Components/LED/5060BRG4.pdf
RGB LED 5050-6
0
6
6
Pocket Voltex
Rasis
0
0
0
Pocket Voltex
SMD_Standoff_M2_Wurth
0
0
0
Pocket Voltex
SW_Cherry_MX1A_1.00u_PCB_Socket
Cherry MX keyswitch, MX1A, 1u, PCB mount, http://cherryamericas.com/wp-content/uploads/2014/12/mx_cat.pdf
cherry mx keyswitch MX1A 1u PCB
0
2
2
Pocket Voltex
SW_Cherry_MX1A_1.25u_PCB_Socket
Cherry MX keyswitch, MX1A, 1.25u, PCB mount, http://cherryamericas.com/wp-content/uploads/2014/12/mx_cat.pdf
cherry mx keyswitch MX1A 1.25u PCB
0
2
2
Pocket Voltex
SW_Cherry_MX1A_2.25u_PCB_Socket
Cherry MX keyswitch, MX1A, 2.25u, PCB mount, http://cherryamericas.com/wp-content/uploads/2014/12/mx_cat.pdf
cherry mx keyswitch MX1A 2.25u PCB
0
2
2
Pocket Voltex
SW_SPST_KSC-G
0
4
2
Pocket Voltex
SW_SPST_KSC-J
0
4
2
Pocket Voltex
USB_C_Receptacle_GCT_USB4085
USB 2.0 Type C Receptacle, https://gct.co/Files/Drawings/USB4085.pdf
USB Type-C Receptacle Through-hole Right angle
0
20
17
Pocket Voltex
USB_C_Receptacle_UJ31-CH-31-SMT-TR
0
30
25
Pocket Voltex
VIA_0.4mm
0
1
1
Pocket Voltex
murata-resonator_SMD_CSTCE16M0V53-R0
./Docs/MURATA__p17e.pdf
resonator, murata, SMD, CSTCE16M0V53-R0
0
3
3
Pocket Voltex
top_art
0
0
0
Pocket Voltex
top_art_gold
0
0
0
Pocket Voltex
top_art_light
0
0
0
Pocket Voltex
top_art_silk
0
0
0
+71
View File
@@ -0,0 +1,71 @@
#
# Example python script to generate a Seeed friendly BOM from a KiCad generic netlist
#
"""
@package
Generate a Tab delimited list (csv file type).
Components are sorted by ref and grouped by value with same footprint
Fields are (if exist)
'Ref', 'Qnty', 'Value', 'Cmp name', 'Footprint', 'Description', 'Part number'
Command line:
python "pathToFile/bom_csv_grouped_by_value_with_fp.py" "%I" "%O.csv"
"""
# be able to find the kicad stuff
import sys
sys.path.append('/usr/share/kicad/plugins')
sys.path.append('C:/Program Files/KiCad/bin/scripting/plugins')
# Import the KiCad python helper module and the csv formatter
import kicad_netlist_reader
import csv
# Generate an instance of a generic netlist, and load the netlist tree from
# the command line option. If the file doesn't exist, execution will stop
net = kicad_netlist_reader.netlist(sys.argv[1])
# Open a file to write to, if the file cannot be opened output to stdout
# instead
try:
f = open(sys.argv[2], 'w')
except IOError:
e = "Can't open output file for writing: " + sys.argv[2]
print(__file__, ":", e, sys.stderr)
f = sys.stdout
# Create a new csv writer object to use as the output formatter
out = csv.writer(f, lineterminator='\n', delimiter=',', quotechar='\"', quoting=csv.QUOTE_ALL)
# Output a set of rows for a header providing general information
print('Component Count:{}'.format(len(net.components)))
out.writerow(['Designator', 'MPN', 'Qty', 'Link', 'Description'])
uniques = set()
# Get all of the components in groups of matching parts + values
# (see ky_generic_netlist_reader.py)
grouped = net.groupComponents()
# Output all of the component information
for group in grouped:
refs = []
# Add the reference of every component in the group and keep a reference
# to the component so that the other data can be filled in once per group
for component in group:
refs.append(component.getRef())
c = component
part = c.getField("Part number")
if not part or part == '-':
print('Skipping {}'.format(c.getRef()))
continue
uniques.add(part)
# Fill in the component groups common data
out.writerow([','.join(refs), part, len(group), c.getField("Link"), c.getDescription()])
print('{} unique parts'.format(len(uniques)))
+31
View File
@@ -0,0 +1,31 @@
EESchema-LIBRARY Version 2.4
#encoding utf-8
#
# SK6812SIDE
#
DEF SK6812SIDE D 0 10 Y Y 1 F N
F0 "D" 200 225 50 H V R BNN
F1 "SK6812SIDE" 50 -225 50 H V L TNN
F2 "led:LED_RGB_SK6812SIDE_4020" 50 -300 50 H I L TNN
F3 "" 100 -375 50 H I L TNN
$FPLIST
LED*SK6812MINI*PLCC*3.5x3.5mm*P1.75mm*
$ENDFPLIST
DRAW
T 0 90 -165 30 0 0 0 RGB Normal 0 C C
S 200 200 -200 -200 0 1 10 f
P 2 0 1 0 50 -140 70 -140 N
P 2 0 1 0 50 -100 70 -100 N
P 2 0 1 0 185 -140 105 -140 N
P 3 0 1 0 90 -100 50 -140 50 -120 N
P 3 0 1 0 90 -60 50 -100 50 -80 N
P 3 0 1 0 145 -40 145 -140 145 -160 N
P 4 0 1 0 185 -60 105 -60 145 -140 185 -60 N
X DIN 1 -300 0 100 R 50 50 1 1 I
X VDD 2 0 300 100 D 50 50 1 1 W
X DOUT 3 300 0 100 L 50 50 1 1 O
X VSS 4 0 -300 100 U 50 50 1 1 W
ENDDRAW
ENDDEF
#
#End Library
+5 -3
View File
@@ -1,3 +1,5 @@
(sym_lib_table
(lib (name PocketVoltex)(type Legacy)(uri ${KIPRJMOD}/PocketVoltex.lib)(options "")(descr ""))
)
(sym_lib_table
(lib (name PocketVoltex)(type Legacy)(uri ${KIPRJMOD}/PocketVoltex.lib)(options "")(descr ""))
(lib (name PocketVoltex-rescue)(type Legacy)(uri ${KIPRJMOD}/PocketVoltex-rescue.lib)(options "")(descr ""))
(lib (name led_parts)(type Legacy)(uri C:/Users/Will/Dropbox/Projects/SDVX/Hardware/led_parts.lib)(options "")(descr ""))
)
+15 -15
View File
@@ -1,16 +1,16 @@
{
"4" :
{
"version": 15,
"board" : 4,
"md5": "fdeec31cc936124b7f21d2bb616c02db",
"changelog" : "Add START lights, defaults reset, fix LED strings"
},
"6" :
{
"version": 15,
"board" : 6,
"md5": "4e12a16e0ca24441f68b1162a09d27be",
"changelog" : "Add START lights, LED brightness, defaults reset, fix LED strings"
}
{
"4" :
{
"version": 16,
"board" : 4,
"md5": "827129485f67cea692d56ed53d199bb5",
"changelog" : "Fix broken config upgrade"
},
"6" :
{
"version": 16,
"board" : 6,
"md5": "5a4eb9356f47febd5fb39e951f7cd75f",
"changelog" : "Fix broken config upgrade"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 103 KiB