Author Topic: NOW OPEN SOURCE!!! swill's plate building tool [builder.swillkb.com]  (Read 2624586 times)

0 Members and 1 Guest are viewing this topic.

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #100 on: Fri, 19 December 2014, 09:38:35 »
I recommend CC-BY or CC-BY-NC[-ND] if you're really paranoid about people making money off you.

"how do you plan to monetize it". If you need more money there are better ways to get it and you can use this as an example of your skills. If people see that and give you a raise / new job then it'll be like money to you. CC-BY also ensures your name gets out there which is always a bonus.

Thanks, I will look into those...

Online Melvang

  • Exquisite Lord of Bumfluff
  • * Maker
  • Posts: 4367
  • Location: Waterloo, IA
  • Melvang's Desktop Customs
Re: swill's plate building tool
« Reply #101 on: Fri, 19 December 2014, 09:54:36 »
"how do you plan to monetize it"? I hate that question, every time I build something, others around me ask this question, be it a module for an existing web solution like XenForo or a keyboard related hobby. Can't a person just do something out of interest without any monetary benefit in mind.


Sorry for the rant. The tool looks great. Perhaps an option to have round corners and specify radius.

I completely agree with your sentiments.  If you want to monetize it that is fine but take it to the full masses rather than just keep it bottled up here in the community.  I just hate when I explain something that I am working on and the first thing people ask me is how much money I am going to make off it.

I hope you didn't think I was sounding to materialistic.  But I am just seeing this as a potential issue for the future.  Say Bigbluesaw.com sees this and wants to imbed the source into their website.  BAM they would be makin a killing off of us.  Or any shop with a laser or waterjet for that matter. 

i think I would suggest looking up the technical differences between the different open source license options.  The differences between what you can and can't do varies quite a bit.

Not at all.  I really appreciate you asking the question and raising it as a concern.  You have a very good point that my good intentions could be abused if we don't put a little thought into protecting our intellectual property.  I still want to open source the code and I want people in the community to be able to use it or contribute without feeling hampered by a license, but I also don't want our work to be abused by others...

Excellent we are at least on the same page here.  I just don't know enough about the details of open source licences to know which to apply.
OG Kishsaver, Razer Orbweaver clears and reds with blue LEDs, and Razer Naga Epic.   "Great minds crawl in the same sewer"  Uncle Rich
Order Form for MDC Mouse Pad
Contact Form for questions

IBM F Revival Services Now with VIDEO

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #102 on: Fri, 19 December 2014, 09:56:51 »
"how do you plan to monetize it"? I hate that question, every time I build something, others around me ask this question, be it a module for an existing web solution like XenForo or a keyboard related hobby. Can't a person just do something out of interest without any monetary benefit in mind.

Sorry for the rant. The tool looks great. Perhaps an option to have round corners and specify radius.

Haha...  Don't apologize for that.  :)  That was hardly a rant at all.  I know where you are coming from though.  Everyone seems to be so obsessed with squeezing every ounce of profitability out of every idea.  What happened to the sense of community and doing things for the greater good?  My own little rant; I grew up in a very challenging environment where everyone had to pitch in and look out for the needs of the people around them just so everyone survived.  That whole concepts seems to be lost on society nowadays.  It makes me sad.  There is nothing more rewarding than helping someone who needs help without expecting anything in return. 

Back on topic.  Yes, I like the idea of adding rounded corners and letting the user specify the radius.  I will work on that when I do the sandwich mount holes.  I have to admit that I don't actually know how to code that yet.  It is easy for me to do straight lines between points because I can just use the polyline concept, but I have not tried to do any sort of arc yet.  I will have to learn how to code arcs to add that.

For example, this is how I draw the switch cutout for the MX + Alps compatible switch type:
Code: [Select]
points = [
    (7,-7), (7,-6), (7.8,-6), (7.8,-2.9), (7,-2.9), (7,2.9), (7.8,2.9), (7.8,6), (7,6), (7,7), (-7,7),
    (-7,6), (-7.8,6), (-7.8,2.9), (-7,2.9), (-7,-2.9), (-7.8,-2.9), (-7.8,-6), (-7,-6), (-7,-7), (7,-7)
]
p = p.polyline(points).cutThruAll()

I will research that on the train on my way home tonight.  It makes sense that I give a full solution for the sandwich case before moving on to other features since that makes it actually usable for people and it is the simplest to build for me.  Once I start trying to support different case mount holes, things are going to get a lot more tricky, so it will be nice if I have a working tool for prototypers before I try to solve that bigger problem.

BTW, pretty much all of my cutouts are my own design because I was trying to improve on existing designs as I built them because I had to draw them from scratch anyway.  I need to get a plate cut with all of the different components on it so I can test to make sure that all of my switch and stabilizer cutouts work as well as I am hoping.  Should I just try to find a local laser or plasma shop for this?  Do you guys have any suggestions for how I should approach this?  I have never done that before...

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #103 on: Fri, 19 December 2014, 22:59:49 »
Not much of an update since I did not have much time to work on this tonight.

I added the feature that MOZ requested of being able to round the corners of the plate.



I also did a bit of a code cleanup and put everything into a class to simplify the inner workings (now that I know things work for the most part).

Code: [Select]
# input is still manually copied from keyboard-layout-editor.com...
input_str = """["Esc","!\n1","@\n2","#\n3","$\n4","%\n5","^\n6","&\n7","*\n8","(\n9",")\n0","_\n-","+\n=",{w:2},"Backspace"],
    [{w:1.5},"Tab","Q","W","E","R","T","Y","U","I","O","P","{\n[","}\n]",{w:1.5},"|\n\\"],
    [{w:1.75},"Control","A","S","D","F","G","H","J","K","L",":\n;","\"\n'",{w:2.25},"Enter"],
    ["Fn",{w:1.25},"Shift","Z","X","C","V","B","N","M","<\n,",">\n.","?\n/","↑",{w:1.75},"Shift"],
    [{x:0.625},"~\n`","Win",{w:1.25},"Alt",{w:6.25},"",{w:1.25},"Alt","←","↓","→"]"""

p = Plate() # init the plate we will be working on.
p.set_x_pad(5) # pad the left and right of the plate with an extra 5mm of space beyond the keycaps.
p.set_y_pad(5) # pad the top and bottom of the plate with an extra 5mm of space beyond the keycaps.
p.set_fillet(5) # round the corners of the plate with a 5mm radius.
p.draw(input_str) # draw the plate based on the input

Online Melvang

  • Exquisite Lord of Bumfluff
  • * Maker
  • Posts: 4367
  • Location: Waterloo, IA
  • Melvang's Desktop Customs
Re: swill's plate building tool
« Reply #104 on: Sat, 20 December 2014, 00:08:27 »
Very nice work.  Just please let us know when you have the mount holes thing figured out please.  I want to build a set of plates for the wifes GH36 and this would be a great way to test the software.
OG Kishsaver, Razer Orbweaver clears and reds with blue LEDs, and Razer Naga Epic.   "Great minds crawl in the same sewer"  Uncle Rich
Order Form for MDC Mouse Pad
Contact Form for questions

IBM F Revival Services Now with VIDEO

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #105 on: Sat, 20 December 2014, 09:59:26 »
Very nice work.  Just please let us know when you have the mount holes thing figured out please.  I want to build a set of plates for the wifes GH36 and this would be a great way to test the software.
Sounds good. I will work on the two things you will need.
1. Mount holes (just sandwich to start with)
2. 1unit vertical keys (with stabs if applicable). ISO support will wait for a little while still.

I think that is all we will need to start prototyping. Am I missing anything?

Offline FrostyToast

  • Litshoard
  • * Exquisite Elder
  • Posts: 2320
  • Location: Canada
Re: swill's plate building tool
« Reply #106 on: Sat, 20 December 2014, 10:04:45 »
Would you be able to just generate a top casing based on negative space that the caps won't occupy?
Quote from: elton5354
I don't need anymore keyboards

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #107 on: Sat, 20 December 2014, 10:10:15 »
Would you be able to just generate a top casing based on negative space that the caps won't occupy?
Sorry, I don't think I understood your question. Can you give me a bit more detail on what you are looking for?

Offline FrostyToast

  • Litshoard
  • * Exquisite Elder
  • Posts: 2320
  • Location: Canada
Re: swill's plate building tool
« Reply #108 on: Sat, 20 December 2014, 10:13:16 »
Would you be able to just generate a top casing based on negative space that the caps won't occupy?
Sorry, I don't think I understood your question. Can you give me a bit more detail on what you are looking for?

By taking the space in between the switches, that is if there is any (like say on a TLK above where the arrow keys are), would you be able to use those dimensions to cut out a top casing?
This would basically be the top part of a case that shrouds the switches which you would see most commonly used elsewhere.
Quote from: elton5354
I don't need anymore keyboards

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #109 on: Sat, 20 December 2014, 11:00:52 »


Would you be able to just generate a top casing based on negative space that the caps won't occupy?
Sorry, I don't think I understood your question. Can you give me a bit more detail on what you are looking for?

By taking the space in between the switches, that is if there is any (like say on a TLK above where the arrow keys are), would you be able to use those dimensions to cut out a top casing?
This would basically be the top part of a case that shrouds the switches which you would see most commonly used elsewhere.

Oh. I now understand what you are asking. Yes, I should be able to do that without too much issue.  Thanks for clarifying. :)

The only thing that I think I would not be able to offer (natively based on the data I have) is the ability to cut out a controller area if you needed a controller cutout in the plate and then put a layer (like you just described) over it.  I don't have any details about controller sizing for a cutout in the layout. I basically support hand wired controllers or controllers that live on the bottom of the PCB. Make sense?

Offline MOZ

  • KING OF THE NEWBIES
  • * Maker
  • Posts: 3966
  • Location: Jo'burg
  • Busy making stuff
Re: swill's plate building tool
« Reply #110 on: Sat, 20 December 2014, 12:03:51 »
Do you know how you will code the mount holes for the sandwitch layer? I have an idea, but I'm on my phone, once I am on my system,  I'll lay it out.

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #111 on: Sat, 20 December 2014, 12:31:54 »
Do you know how you will code the mount holes for the sandwitch layer? I have an idea, but I'm on my phone, once I am on my system,  I'll lay it out.
Please offer suggestions. I am working some algorithms out in my head, but I have not put anything down on paper yet.

I would like to give control of:
- size of hole
- number of holes

My assumptions:
- minimum of 4 holes which will go in the corners
- the holes will be centered in the x and y padding (which is already configurable)

First shot at writing down an algorithm.

First 4 holes are located in the corners. The remaining holes are placed evenly(?) around the board. This will consider the ratio of board length to width as well as total perimeter length needing to be secured. I need to sit down with some paper and a pencil to hash out the details of how this algorithm is going to work exactly, but that is the idea.

Ideas? Thoughts?

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #112 on: Sat, 20 December 2014, 12:51:46 »
What is the ideal way to get plates cut?  I think laser or plasma cutting is common (given what I have seen). What precision can they offer with aluminum or steel?  I know there can be some issues with warping and such due to the heat in processing.

What about water jet? Is it precise enough? 

What other options are there. CNC has I set of challenges I can not currently handle. I will let nudecnc sort out the details there. 

Other ideas?

Online Melvang

  • Exquisite Lord of Bumfluff
  • * Maker
  • Posts: 4367
  • Location: Waterloo, IA
  • Melvang's Desktop Customs
Re: swill's plate building tool
« Reply #113 on: Sat, 20 December 2014, 13:51:00 »
What is the ideal way to get plates cut?  I think laser or plasma cutting is common (given what I have seen). What precision can they offer with aluminum or steel?  I know there can be some issues with warping and such due to the heat in processing.

What about water jet? Is it precise enough? 

What other options are there. CNC has I set of challenges I can not currently handle. I will let nudecnc sort out the details there. 

Other ideas?

Laser and water jet are the most common with laser being more common here from what I have seen probably due to being more popular equipment.
OG Kishsaver, Razer Orbweaver clears and reds with blue LEDs, and Razer Naga Epic.   "Great minds crawl in the same sewer"  Uncle Rich
Order Form for MDC Mouse Pad
Contact Form for questions

IBM F Revival Services Now with VIDEO

Offline FrostyToast

  • Litshoard
  • * Exquisite Elder
  • Posts: 2320
  • Location: Canada
Re: swill's plate building tool
« Reply #114 on: Sat, 20 December 2014, 15:27:35 »


Would you be able to just generate a top casing based on negative space that the caps won't occupy?
Sorry, I don't think I understood your question. Can you give me a bit more detail on what you are looking for?

By taking the space in between the switches, that is if there is any (like say on a TLK above where the arrow keys are), would you be able to use those dimensions to cut out a top casing?
This would basically be the top part of a case that shrouds the switches which you would see most commonly used elsewhere.

Oh. I now understand what you are asking. Yes, I should be able to do that without too much issue.  Thanks for clarifying. :)

The only thing that I think I would not be able to offer (natively based on the data I have) is the ability to cut out a controller area if you needed a controller cutout in the plate and then put a layer (like you just described) over it.  I don't have any details about controller sizing for a cutout in the layout. I basically support hand wired controllers or controllers that live on the bottom of the PCB. Make sense?

That's cool. I honestly think bottom mounted controllers would be more relevant for hand wiring anyway.
Quote from: elton5354
I don't need anymore keyboards

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #115 on: Sat, 20 December 2014, 17:13:59 »
What is the ideal way to get plates cut?  I think laser or plasma cutting is common (given what I have seen). What precision can they offer with aluminum or steel?  I know there can be some issues with warping and such due to the heat in processing.

What about water jet? Is it precise enough? 

What other options are there. CNC has I set of challenges I can not currently handle. I will let nudecnc sort out the details there. 

Other ideas?

Laser and water jet are the most common with laser being more common here from what I have seen probably due to being more popular equipment.
You have any idea what kind of tolerances they can hit?

Online Melvang

  • Exquisite Lord of Bumfluff
  • * Maker
  • Posts: 4367
  • Location: Waterloo, IA
  • Melvang's Desktop Customs
Re: swill's plate building tool
« Reply #116 on: Sat, 20 December 2014, 20:20:30 »
Mkawa could give you a better answer on tolerances as he has had a lot more dealings with fab shops in that regard.  The one shop I was talking to quoted me at .005" in 16ga stainless.  For waterjet I am not sure what they can hit for tolerances.  I do know that laser has a smaller kerf in general than wj.  Laser is more expensive per hour on machine time but cuts much faster than wj.
OG Kishsaver, Razer Orbweaver clears and reds with blue LEDs, and Razer Naga Epic.   "Great minds crawl in the same sewer"  Uncle Rich
Order Form for MDC Mouse Pad
Contact Form for questions

IBM F Revival Services Now with VIDEO

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #117 on: Sat, 20 December 2014, 22:54:49 »
Nothing exciting got done on the actual tool today, but I was able to build an algorithm for determining the number of holes which should be placed on each side of the plate based on the ratio of height (y) and width (x) of the plate.  If x and y are equal and the the number of holes is not divisible by 4, the x side will get the extra hole.

I am sure there is an easier and more concise way to write this logic, but for some reason I could not get my head around it.  So this code basically solves the problem by looping through the holes that need to be placed and it determines if the hole should be placed on the x or y side.  keep in mind that there are actually two x and two y sides.  Also keep in mind that the first 4 holes are always placed in the corners.

Once we know the number of holes we are putting on each side, it is very easy to space them evenly, so that logic is not present in this code.

Code: [Select]
#!/usr/bin/env python

"""
Usage:
  holes.py --x=<x> --y=<y> --holes=<holes>
  holes.py (-h | --help)
"""

from docopt import docopt
args = docopt(__doc__)

if __name__ == "__main__":
holes = int(args['--holes'])
if holes % 2 == 0 and holes >= 4: # holes needs to be even and the first 4 are put in the corners
x = float(args['--x']) # x length
y = float(args['--y']) # y length
_x = 0 # number of holes on each x side (not counting the corner holes)
_y = 0 # number of holes on each y side (not counting the corner holes)
free = (holes-4)/2 # number of free holes to be placed on either x or y sides
for f in range(free): # loop through the available holes and place them
if x/(_x+1) == y/(_y+1): # if equal, add the hole to the longer side
if x >= y: # if x and y are equal, add the extra hole to the x side
_x += 1
else:
_y += 1
elif x/(_x+1) > y/(_y+1):
_x += 1
else:
_y += 1
print("%s holes on 'x' over %smm" % (_x, x))
print("%s holes on 'y' over %smm" % (_y, y))
print("plus one hole in each corner\n")
else:
print("'--holes' needs to be an even number greater than or equal to 4")

Here is some example output:
Code: [Select]
$ ./holes.py --x=400 --y=100 --holes=2
'--holes' needs to be an even number greater than or equal to 4

$ ./holes.py --x=400 --y=100 --holes=4
0 holes on 'x' over 400.0mm
0 holes on 'y' over 100.0mm
plus one hole in each corner

$ ./holes.py --x=400 --y=100 --holes=12
4 holes on 'x' over 400.0mm
0 holes on 'y' over 100.0mm
plus one hole in each corner

$ ./holes.py --x=400 --y=100 --holes=14
4 holes on 'x' over 400.0mm
1 holes on 'y' over 100.0mm
plus one hole in each corner

$ ./holes.py --x=200 --y=100 --holes=12
3 holes on 'x' over 200.0mm
1 holes on 'y' over 100.0mm
plus one hole in each corner

$ ./holes.py --x=200 --y=100 --holes=14
4 holes on 'x' over 200.0mm
1 holes on 'y' over 100.0mm
plus one hole in each corner

$ ./holes.py --x=200 --y=100 --holes=16
4 holes on 'x' over 200.0mm
2 holes on 'y' over 100.0mm
plus one hole in each corner

$ ./holes.py --x=200 --y=100 --holes=36
11 holes on 'x' over 200.0mm
5 holes on 'y' over 100.0mm
plus one hole in each corner

Let me know if I am just having a super brain fart day and there is a much simpler way to solve this.  Haha... 

I should be able to get a good start on the code to actually add the holes to the plate tomorrow.  Cheers...
« Last Edit: Sat, 20 December 2014, 22:58:37 by swill »

Offline dorkvader

  • Posts: 6274
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: swill's plate building tool
« Reply #118 on: Sat, 20 December 2014, 23:48:58 »
Mkawa could give you a better answer on tolerances as he has had a lot more dealings with fab shops in that regard.  The one shop I was talking to quoted me at .005" in 16ga stainless.  For waterjet I am not sure what they can hit for tolerances.  I do know that laser has a smaller kerf in general than wj.  Laser is more expensive per hour on machine time but cuts much faster than wj.

depends on the shop of course, but IIRC the only issue with WC is finding a place taht has one with tight enough tolerances. You need relatively good to get cherry switches to fit which is why most are lasered.

Quote
# input is still manually copied from keyboard-layout-editor.com...

TBH I am okay with that, It's not that hard to do and half the time I manually input into "raw data" anyway. much faster. I have no problem copypasta-ing a layout from there into your tool and pressing the :go: button.

But I'm more worried about the result. THe 5 seconds of extra time investiture it'll take for me to copypaste is nothing compared with the time it'd take to build a plate layout on my own.

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #119 on: Sun, 21 December 2014, 00:10:54 »
Mkawa could give you a better answer on tolerances as he has had a lot more dealings with fab shops in that regard.  The one shop I was talking to quoted me at .005" in 16ga stainless.  For waterjet I am not sure what they can hit for tolerances.  I do know that laser has a smaller kerf in general than wj.  Laser is more expensive per hour on machine time but cuts much faster than wj.

depends on the shop of course, but IIRC the only issue with WC is finding a place taht has one with tight enough tolerances. You need relatively good to get cherry switches to fit which is why most are lasered.

Quote
# input is still manually copied from keyboard-layout-editor.com...

TBH I am okay with that, It's not that hard to do and half the time I manually input into "raw data" anyway. much faster. I have no problem copypasta-ing a layout from there into your tool and pressing the :go: button.

But I'm more worried about the result. THe 5 seconds of extra time investiture it'll take for me to copypaste is nothing compared with the time it'd take to build a plate layout on my own.

Re: Waterjet vs Laser cutting; I am looking at my options here in montreal and I will get quotes from a couple shops to see what I can get done.  Thanks for the answer...  :)

Re: Copy and Paste; That is simply because I have not gotten around to supporting the permalink url yet.  I plan to offer both options, but I have to start somewhere.  I am focusing on shortest path to something useful.  Once I have that and have tested all of my switch cutouts, it will be a legitimate tool that people can start using.  I will then start to work on some of the more edge cases, nice to have or harder features.

All a work in progress...  :)

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #120 on: Mon, 22 December 2014, 00:06:24 »
More progress tonight... 

I now officially support the sandwich case holes in the plate.  I still have not started working on building the other layers of the sandwich case, but I may do that next as it is pretty relevant to this addition.

This first render is using 6mm of space around the board outside the caps with a 3mm fillet on the corners.  It has 14 holes that are 2mm in diameter.  Each hole is about 5cm apart.


This second render is more of the 'bomb proof' version.  In this render I have 8mm of space outside the keycaps all the way around the board with a 4mm fillet on the corners.  I am using 30 holes that are 3mm in diameter and about 2.5cm apart.


Here is the code to generate the second render to give you an idea how this is being configured...
Code: [Select]
input_str = """["Esc","!\n1","@\n2","#\n3","$\n4","%\n5","^\n6","&\n7","*\n8","(\n9",")\n0","_\n-","+\n=",{w:2},"Backspace"],
    [{w:1.5},"Tab","Q","W","E","R","T","Y","U","I","O","P","{\n[","}\n]",{w:1.5},"|\n\\"],
    [{w:1.75},"Control","A","S","D","F","G","H","J","K","L",":\n;","\"\n'",{w:2.25},"Enter"],
    ["Fn",{w:1.25},"Shift","Z","X","C","V","B","N","M","<\n,",">\n.","?\n/","↑",{w:1.75},"Shift"],
    [{x:0.625},"~\n`","Win",{w:1.25},"Alt",{w:6.25},"",{w:1.25},"Alt","←","↓","→"]"""

p = Plate() # init the plate
p.set_x_pad(8) # 8mm of extra space on the top and bottom
p.set_y_pad(8) # 8mm of extra space on the left and right
p.set_fillet(4) # 4mm fillet on the corners of the plate
p.set_case_holes(30, 3) # draw 30 holes with a 3mm diameter
p.draw(input_str) # do magic!!!  :)

Starting to feel like we are getting there.  I still need to finish the other layers of the case to let people build a whole case with the tool.  That was not my original goal, but it makes total sense to do it, so why not...  Once I do that, the next big hurdle for this to be 'game ready' is adding support for vertical keys (as well as stabilizing them).  If we are lucky I will get there by new years...  :)  Oh and I need to get a sample plate cut so I can verify all my cutouts work as expected...
« Last Edit: Mon, 22 December 2014, 00:10:07 by swill »

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #121 on: Mon, 22 December 2014, 13:33:58 »
I am wondering what formats I should be offering for export.  I am currently exporting in SVG, DFX and DWG formats.  Are there other formats I should be considering?

Here are the available extensions that I can export as:
ast, bms, brep, brp, csg, csv, dae, dat, dwg, dxf, html, ifc, iges, igs, inp, iv, med, obj, oca, off, pdf, ply, poly, scad, step, stl, stp, svg, unv, vrml, wrl, wrl.gz, wrz

For example, the last render in the previous post would produce the attached files...
« Last Edit: Mon, 22 December 2014, 13:35:38 by swill »

Offline MOZ

  • KING OF THE NEWBIES
  • * Maker
  • Posts: 3966
  • Location: Jo'burg
  • Busy making stuff
Re: swill's plate building tool
« Reply #122 on: Mon, 22 December 2014, 14:48:35 »
Those are the big three and should suffice.

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #123 on: Mon, 22 December 2014, 14:59:58 »
Those are the big three and should suffice.

Cool, thanks...  On my laptop I have dedicated 2 cores and 4GB of ram to the system running this and it is taking about 2 minutes to build that relatively simple layout.  I am spinning up a new machine in our cloud which has 4 cores and 16GB of ram to start running my code on that.  Hopefully that will reduce the build time to something closer to a minute.  I think people won't mind waiting for a minute or two to get everything drawn for them.  :P  Doesn't mean I don't want to try to speed it up though...

Online Melvang

  • Exquisite Lord of Bumfluff
  • * Maker
  • Posts: 4367
  • Location: Waterloo, IA
  • Melvang's Desktop Customs
Re: swill's plate building tool
« Reply #124 on: Mon, 22 December 2014, 15:03:56 »
Those are the big three and should suffice.

Cool, thanks...  On my laptop I have dedicated 2 cores and 4GB of ram to the system running this and it is taking about 2 minutes to build that relatively simple layout.  I am spinning up a new machine in our cloud which has 4 cores and 16GB of ram to start running my code on that.  Hopefully that will reduce the build time to something closer to a minute.  I think people won't mind waiting for a minute or two to get everything drawn for them.  :P  Doesn't mean I don't want to try to speed it up though...

Any chance there would be a possibility for a downloadable app?  Granted it would probably need to support 3 major OS's.  Just curious.
OG Kishsaver, Razer Orbweaver clears and reds with blue LEDs, and Razer Naga Epic.   "Great minds crawl in the same sewer"  Uncle Rich
Order Form for MDC Mouse Pad
Contact Form for questions

IBM F Revival Services Now with VIDEO

Offline joey

  • Posts: 1890
  • Location: UK
Re: swill's plate building tool
« Reply #125 on: Mon, 22 December 2014, 16:06:20 »
Cool, thanks...  On my laptop I have dedicated 2 cores and 4GB of ram to the system running this and it is taking about 2 minutes
Is it multithreaded? .. and is it actually using that much RAM?

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #126 on: Mon, 22 December 2014, 16:12:35 »
Those are the big three and should suffice.

Cool, thanks...  On my laptop I have dedicated 2 cores and 4GB of ram to the system running this and it is taking about 2 minutes to build that relatively simple layout.  I am spinning up a new machine in our cloud which has 4 cores and 16GB of ram to start running my code on that.  Hopefully that will reduce the build time to something closer to a minute.  I think people won't mind waiting for a minute or two to get everything drawn for them.  :P  Doesn't mean I don't want to try to speed it up though...

Any chance there would be a possibility for a downloadable app?  Granted it would probably need to support 3 major OS's.  Just curious.

Not likely since FreeCAD is a dependency and it is a total PITA to setup and get working.  I am actually installing this on a server right now so once it is setup and working correctly I can just snapshot the VM and not have to deal with the setup again if I have to move the box or give it more resources. 

I am working on exposing the controls through a web UI right now which will allow you to download the resulting cad files that are created. Basically you will specify your layout (or a enter the permalink to the keyboard-layout-editor.com layout) and set a bunch of things like type of switch, mount holes, padding, etc, etc, and then you will hit a button something like 'draw cad' and it will process for a couple minutes and it will give you links to download the cad files as well as show you a preview of the cad.  The preview is because I expect that you may realize once it is generated that you might want different size padding or that sort of thing and instead of making you enter everything again, you can just tweak the settings and regenerate and it will then show you the result as well as give you the download links for the updated run.  Thats the idea anyway...

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #127 on: Mon, 22 December 2014, 16:15:36 »
Cool, thanks...  On my laptop I have dedicated 2 cores and 4GB of ram to the system running this and it is taking about 2 minutes
Is it multithreaded? .. and is it actually using that much RAM?

No it is currently not multithreaded.  Right now I am just making it work.  I am giving it a lot of resources because I have not profiled it or anything yet so I am just throwing resources at it right now to see if it speeds things up.  I work at a cloud computing company, so I have lots of resources at my fingertips for free, so I have the luxury of being able to do that.  :)  Once I get the functionality in place I will start to worry about performance and such.  For now I just want to focus on shortest path to something useful...

Offline joey

  • Posts: 1890
  • Location: UK
Re: swill's plate building tool
« Reply #128 on: Mon, 22 December 2014, 17:08:50 »
Is it multithreaded? .. and is it actually using that much RAM?

No it is currently not multithreaded.  Right now I am just making it work.  I am giving it a lot of resources because I have not profiled it or anything yet so I am just throwing resources at it right now to see if it speeds things up.

Just wondering :)

Those are the big three and should suffice.

Cool, thanks...  On my laptop I have dedicated 2 cores and 4GB of ram to the system running this and it is taking about 2 minutes to build that relatively simple layout.  I am spinning up a new machine in our cloud which has 4 cores and 16GB of ram to start running my code on that.  Hopefully that will reduce the build time to something closer to a minute.  I think people won't mind waiting for a minute or two to get everything drawn for them.  :P  Doesn't mean I don't want to try to speed it up though...

Any chance there would be a possibility for a downloadable app?  Granted it would probably need to support 3 major OS's.  Just curious.

Not likely since FreeCAD is a dependency and it is a total PITA to setup and get working.  I am actually installing this on a server right now so once it is setup and working correctly I can just snapshot the VM and not have to deal with the setup again if I have to move the box or give it more resources. 

I am working on exposing the controls through a web UI right now which will allow you to download the resulting cad files that are created. Basically you will specify your layout (or a enter the permalink to the keyboard-layout-editor.com layout) and set a bunch of things like type of switch, mount holes, padding, etc, etc, and then you will hit a button something like 'draw cad' and it will process for a couple minutes and it will give you links to download the cad files as well as show you a preview of the cad.  The preview is because I expect that you may realize once it is generated that you might want different size padding or that sort of thing and instead of making you enter everything again, you can just tweak the settings and regenerate and it will then show you the result as well as give you the download links for the updated run.  Thats the idea anyway...

Have you looked at generating .dxf or other types directly?

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #129 on: Mon, 22 December 2014, 17:14:46 »
Those are the big three and should suffice.

Cool, thanks...  On my laptop I have dedicated 2 cores and 4GB of ram to the system running this and it is taking about 2 minutes to build that relatively simple layout.  I am spinning up a new machine in our cloud which has 4 cores and 16GB of ram to start running my code on that.  Hopefully that will reduce the build time to something closer to a minute.  I think people won't mind waiting for a minute or two to get everything drawn for them.  :P  Doesn't mean I don't want to try to speed it up though...

Any chance there would be a possibility for a downloadable app?  Granted it would probably need to support 3 major OS's.  Just curious.

Not likely since FreeCAD is a dependency and it is a total PITA to setup and get working.  I am actually installing this on a server right now so once it is setup and working correctly I can just snapshot the VM and not have to deal with the setup again if I have to move the box or give it more resources. 

I am working on exposing the controls through a web UI right now which will allow you to download the resulting cad files that are created. Basically you will specify your layout (or a enter the permalink to the keyboard-layout-editor.com layout) and set a bunch of things like type of switch, mount holes, padding, etc, etc, and then you will hit a button something like 'draw cad' and it will process for a couple minutes and it will give you links to download the cad files as well as show you a preview of the cad.  The preview is because I expect that you may realize once it is generated that you might want different size padding or that sort of thing and instead of making you enter everything again, you can just tweak the settings and regenerate and it will then show you the result as well as give you the download links for the updated run.  Thats the idea anyway...

Have you looked at generating .dxf or other types directly?

Yes, the tool currently exports into the following 3 formats; SVG, DFX and DWG.  I posted some example exports about 7-10 posts ago.  I also listed other export formats which are 'theoretically' possible.  Let me know if there are others in that list that you think would be valuable to export.

Offline joey

  • Posts: 1890
  • Location: UK
Re: swill's plate building tool
« Reply #130 on: Mon, 22 December 2014, 18:41:35 »
Those are the big three and should suffice.

Cool, thanks...  On my laptop I have dedicated 2 cores and 4GB of ram to the system running this and it is taking about 2 minutes to build that relatively simple layout.  I am spinning up a new machine in our cloud which has 4 cores and 16GB of ram to start running my code on that.  Hopefully that will reduce the build time to something closer to a minute.  I think people won't mind waiting for a minute or two to get everything drawn for them.  :P  Doesn't mean I don't want to try to speed it up though...

Any chance there would be a possibility for a downloadable app?  Granted it would probably need to support 3 major OS's.  Just curious.

Not likely since FreeCAD is a dependency and it is a total PITA to setup and get working.  I am actually installing this on a server right now so once it is setup and working correctly I can just snapshot the VM and not have to deal with the setup again if I have to move the box or give it more resources. 

I am working on exposing the controls through a web UI right now which will allow you to download the resulting cad files that are created. Basically you will specify your layout (or a enter the permalink to the keyboard-layout-editor.com layout) and set a bunch of things like type of switch, mount holes, padding, etc, etc, and then you will hit a button something like 'draw cad' and it will process for a couple minutes and it will give you links to download the cad files as well as show you a preview of the cad.  The preview is because I expect that you may realize once it is generated that you might want different size padding or that sort of thing and instead of making you enter everything again, you can just tweak the settings and regenerate and it will then show you the result as well as give you the download links for the updated run.  Thats the idea anyway...

Have you looked at generating .dxf or other types directly?

Yes, the tool currently exports into the following 3 formats; SVG, DFX and DWG.  I posted some example exports about 7-10 posts ago.  I also listed other export formats which are 'theoretically' possible.  Let me know if there are others in that list that you think would be valuable to export.

Sorry, I meant generating dxf without going via FreeCAD.

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #131 on: Mon, 22 December 2014, 19:19:15 »
Those are the big three and should suffice.

Cool, thanks...  On my laptop I have dedicated 2 cores and 4GB of ram to the system running this and it is taking about 2 minutes to build that relatively simple layout.  I am spinning up a new machine in our cloud which has 4 cores and 16GB of ram to start running my code on that.  Hopefully that will reduce the build time to something closer to a minute.  I think people won't mind waiting for a minute or two to get everything drawn for them.    Doesn't mean I don't want to try to speed it up though...

Any chance there would be a possibility for a downloadable app?  Granted it would probably need to support 3 major OS's.  Just curious.

Not likely since FreeCAD is a dependency and it is a total PITA to setup and get working.  I am actually installing this on a server right now so once it is setup and working correctly I can just snapshot the VM and not have to deal with the setup again if I have to move the box or give it more resources. 

I am working on exposing the controls through a web UI right now which will allow you to download the resulting cad files that are created. Basically you will specify your layout (or a enter the permalink to the keyboard-layout-editor.com layout) and set a bunch of things like type of switch, mount holes, padding, etc, etc, and then you will hit a button something like 'draw cad' and it will process for a couple minutes and it will give you links to download the cad files as well as show you a preview of the cad.  The preview is because I expect that you may realize once it is generated that you might want different size padding or that sort of thing and instead of making you enter everything again, you can just tweak the settings and regenerate and it will then show you the result as well as give you the download links for the updated run.  Thats the idea anyway...

Have you looked at generating .dxf or other types directly?

Yes, the tool currently exports into the following 3 formats; SVG, DFX and DWG.  I posted some example exports about 7-10 posts ago.  I also listed other export formats which are 'theoretically' possible.  Let me know if there are others in that list that you think would be valuable to export.

Sorry, I meant generating dxf without going via FreeCAD.
How?  I am using the fact that freecad is built on python and has an accessible API which I can code against.  Everything  about this tool is automated. Basically it can parse any layout (in theory, not finished) and build the corresponding cad file(s). How else would I do this?  Do you know of other options for programmatically building cad that may be better?

Offline MOZ

  • KING OF THE NEWBIES
  • * Maker
  • Posts: 3966
  • Location: Jo'burg
  • Busy making stuff
Re: swill's plate building tool
« Reply #132 on: Tue, 23 December 2014, 01:06:44 »
I think you can generate SVG files much like html files, by printing the drawing out to a file on the server and then allowing the user to download it.

Offline joey

  • Posts: 1890
  • Location: UK
Re: swill's plate building tool
« Reply #133 on: Tue, 23 December 2014, 05:45:00 »
Sorry, I meant generating dxf without going via FreeCAD.
How?  I am using the fact that freecad is built on python and has an accessible API which I can code against.  Everything  about this tool is automated. Basically it can parse any layout (in theory, not finished) and build the corresponding cad file(s). How else would I do this?  Do you know of other options for programmatically building cad that may be better?
I haven't looked, but I was assuming there might be sosom Python libraries for generating dxf.

Just a thought..

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #134 on: Tue, 23 December 2014, 07:50:41 »
I think you can generate SVG files much like html files, by printing the drawing out to a file on the server and then allowing the user to download it.
Yes. SVG is easier to generate. DXF and DWG are harder because you need special libs to export them.

Last night I spent like 3-4 hours on the exporting stuff and I am still not where I want to be.  The export depended on the UI libs in freecad in my old env, but now that I am running this on a server I don't have that UI env. I will sort it out, but it is being a pita. I may have to export to svg and then convert the file to dfx and dwg. We will see...

Offline MOZ

  • KING OF THE NEWBIES
  • * Maker
  • Posts: 3966
  • Location: Jo'burg
  • Busy making stuff
Re: swill's plate building tool
« Reply #135 on: Tue, 23 December 2014, 08:18:51 »
I would be fine with only SVG export.

Offline engicoder

  • Posts: 708
  • Location: North Carolina
Re: swill's plate building tool
« Reply #136 on: Tue, 23 December 2014, 17:37:49 »
DWG is such an ugly beast. Its alive. It mutates constantly. The Open Design Alliance intended to create a library to give "open" access to read and create DWG files (now called Teigha)...but somewhere along the line "open" became "for members" and the cheapest membership is $250 to join and $100 a year. There are a few other libraries of decent quality, but non are free...that I know of.
   

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #137 on: Tue, 23 December 2014, 18:12:24 »
DWG is such an ugly beast. Its alive. It mutates constantly. The Open Design Alliance intended to create a library to give "open" access to read and create DWG files (now called Teigha)...but somewhere along the line "open" became "for members" and the cheapest membership is $250 to join and $100 a year. There are a few other libraries of decent quality, but non are free...that I know of.

Interesting, thanks for the info. I am actually using some teigha libs which integrate into freecad. Apparently freecad has some not-so-pythonic practices going on though because I have to have the GUI installed to use those libs (even though everything is supposed to be able to be run through the core interpreter).

Unfortunately I have spent like 6-8 hours working on getting things to work (aka - export) again since I moved the code to my server and off my Ubuntu VM (with xorg). I will spend a few more hours trying to make it work natively, after that I will explore exporting to something like STEP and then converting to the other types with another tool.

Anyone know what formats are good 'transitional' formats which are good for converting to other formats?  I know that STL is a lossy format, so that is out right away.  I am pretty sure that I can easily export to STEP or BREP, but I don't know cad formats that well. I am totally a CAD noob (which is probably why I am building this tool since I am more comfortable in code and the command line). :). I'm learning slowly.

Thanks to everyone who has been active in this process, your feedback and thoughts are really appreciated.

Online Melvang

  • Exquisite Lord of Bumfluff
  • * Maker
  • Posts: 4367
  • Location: Waterloo, IA
  • Melvang's Desktop Customs
Re: swill's plate building tool
« Reply #138 on: Tue, 23 December 2014, 20:44:37 »
Just for reference but for the padding, what does it measure from?  Would it be possible to allow just to be able to enter edge to edge dimensions and just have the tool center the stuff inside those dimensions?  The reason I ask is I want to make a plate and stuff for the wifes GH36 and it will be very easy for me to get the outside dimensions and not have to do maths to figure "padding".
OG Kishsaver, Razer Orbweaver clears and reds with blue LEDs, and Razer Naga Epic.   "Great minds crawl in the same sewer"  Uncle Rich
Order Form for MDC Mouse Pad
Contact Form for questions

IBM F Revival Services Now with VIDEO

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #139 on: Tue, 23 December 2014, 22:05:23 »
Just for reference but for the padding, what does it measure from?  Would it be possible to allow just to be able to enter edge to edge dimensions and just have the tool center the stuff inside those dimensions?  The reason I ask is I want to make a plate and stuff for the wifes GH36 and it will be very easy for me to get the outside dimensions and not have to do maths to figure "padding".

After I get the first iteration built where you can specify a padding and have mount holes for the sandwich case drilled in that space, I will then start working on exactly what you just specified.  I am going to have to do this anyway because I want to support existing cases.  In order to support existing cases, I have to work within the dimensions of those cases and their mount holes.  That is very much on my radar and is something I will have to tackle soon, but I have not gotten around to it yet.  Hopefully I can really progress this software over the holidays, we will see...

I should call the local laser shops tomorrow and see what my lead time and cost will be for getting a simple plate cut with all my different cutouts on it so I can validate that all my cutouts work before I release this into the wild.  I wanted to get everything drawn for my first case so I could get it cut at the same time (hoping everything works as expected) because it will bring down the cost if I get it cut at the same time.  I think I will probably target the first week or so of january for getting prototypes cut (since I don't think its realistic to get stuff done before then due to the holidays).  Hopefully I can be at the point where I can implement what you are looking for and test it on a 60% plate when I get the prototypes cut so I can validate it against another hammer plate I have here...

I was hoping to be a bit farther along to be honest, I had a really good run there for a bit, but now I have been stalled for a few days on the export stuff now that I moved from a desktop ubuntu setup to a server ubuntu setup.  Apparently the SVG, DWG and DFX export libraries depend on global variables that are set in the GUI runtime (which is ****ing retarded), so they do not work now that I have moved to my server.  I have successfully gotten the BREP and IGES formats to export from the server environment, so I may be getting closer to getting out of the woods.  I am learning all this CAD stuff, but the BREP format seems to be relatively promising based on how it builds the objects.  I still have not checked to see if there is an easy way to convert a BREP file to an SVG, DFX or DWG yet...

I am slowly hashing my way through this crap.  I apologize for being a bit slow to get something out that you guys can play with.  Getting this working on my server is the first step because then it is a much smaller step to get something served over HTTP for you guys to start messing with.  I need exporting to be working in a way I am happy with first though...
« Last Edit: Tue, 23 December 2014, 22:07:43 by swill »

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #140 on: Tue, 23 December 2014, 22:12:15 »
Just for reference but for the padding, what does it measure from?  Would it be possible to allow just to be able to enter edge to edge dimensions and just have the tool center the stuff inside those dimensions?  The reason I ask is I want to make a plate and stuff for the wifes GH36 and it will be very easy for me to get the outside dimensions and not have to do maths to figure "padding".

I just realized that I did not answer your question.  I calculate each switch as being 19.05mm square.  Obviously, the switch hole itself is only 14mm square, so it is centered in that 19.05mm space.  I am using the 19.05mm size as the edges of my plate if there is zero padding.  This means that there is about 2.5mm of space between the switch opening and the edge of the plate when you select zero padding (obviously changes a bit depending on the switch opening you select since the ability to open the switch eats into that space).  Make sense?

I just checked a couple keycaps with a caliper.  An SA cap is 18.3mm square and a GMK cap is 18.2mm square, so they are pretty consistent.  So with a padding of zero, the edge of the plate will be about 0.35mm outside of the edge of the keycap.  So just looking at my board here, it looks like the edge will be pretty much in line with the edge of the angle produced by an SA keycap.  Not sure if any of that is helpful for you...
« Last Edit: Tue, 23 December 2014, 22:17:03 by swill »

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #141 on: Tue, 23 December 2014, 22:22:04 »
In my reading, it appears that the STEP format does not allow for the drawing to be edited since it does not have the tree of changes (or something along those lines).  I want to make sure that whatever format I export into it can be edited by someone in a standard CAD program in case they want to tweak things in the design (if I don't support 100% of what they want).  What formats should I be looking at?

Theoretically FreeCAD supports the following formats, however the following modules do not seem to work from the command line without the GUI; importDXF, FreeCADGui, importSVG.  I have not tested many, but I know that all of the 'Part' formats export fine...

Code: [Select]
# EXPORT FORMATS
# 'med': 'Fem'
# 'inp': 'Fem'
# 'scad': 'exportCSG'
# 'poly': 'convert2TetGen'
# 'brp': 'Part'
# 'dxf': 'importDXF'
# 'igs': 'Part'
# 'oca': 'importOCA'
# 'csg': 'exportCSG'
# 'off': 'Mesh'
# 'html': 'importWebGL'
# 'wrl.gz': 'FreeCADGui'
# 'dwg': 'importDWG'
# 'csv': 'Spreadsheet'
# 'wrz': 'FreeCADGui'
# 'vrml': 'FreeCADGui'
# 'dae': 'importDAE'
# 'ast': 'Mesh'
# 'ply': 'Mesh'
# 'dat': 'Fem'
# 'bms': 'Mesh'
# 'step': 'ImportGui'
# 'iges': 'Part'
# 'iv': 'FreeCADGui'
# 'obj': ['Mesh', 'importOBJ']
# 'unv': 'Fem'
# 'stl': 'Mesh'
# 'svg': ['importSVG', 'FreeCADGui']
# 'stp': 'ImportGui'
# 'ifc': 'importIFC'
# 'pdf': 'FreeCADGui'
# 'wrl': 'FreeCADGui'
# 'brep': 'Part'

Edit:  So I have been doing a bunch of testing tonight.  I have been able to export using the following modules: Mesh, Part.  I have been able to export the following formats (so far, I expect all the Mesh types to work): BRP (BREP), IGS (IGES), SCAD, STL, STP (STEP) 
I am starting to feel like I am getting somewhere.  Hopefully one of these formats will be easy to convert to an SVG and the other formats I am not able to export natively...
« Last Edit: Tue, 23 December 2014, 23:14:31 by swill »

Offline MOZ

  • KING OF THE NEWBIES
  • * Maker
  • Posts: 3966
  • Location: Jo'burg
  • Busy making stuff
Re: swill's plate building tool
« Reply #142 on: Wed, 24 December 2014, 00:47:44 »
This export thing looks like a PITA.

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #143 on: Sun, 28 December 2014, 14:09:28 »
So I have been battling with the different export formats and different ways to present the plates on the screen once the export is completed.

I have had some good success with the Threejs javascript library and have been able to export into a json format which gives a nice visual representation of the plate in the UI.  Here are some screenshots to give you an idea.  This is a perspective view, so you can see that the plate is 3D.  You can rotate the plate and move it around as well as zoom all in the browser.  I think this is a nice visualization for the generated plate and it seems to work pretty well.

85518-0

85520-1

85522-2

On the other hand, the export formats have been a total PITA.  I have been able successfully export into a bunch of formats which work well in cad, however, they do not export with all of the components which make up the drawing, so they are not editable once they are imported into the cad software.  If my tool works perfectly and the result is exactly what the end user wants, then fine, we dont have a problem.  I suspect though that some people will use my tool as a starting point and they may want to make small modifications to the drawing after.  If this is the case none of these formats will work.  With all of these 'drawing as one object' formats, I have had pretty good success with the BREP or BRP format.  It has been rock solid for me and seems to be a pretty standard format, so I will probably offer that format regardless.  It exports quickly, it shows all the segments and anchor points even if they are not split out into their own tree, so it seems to be a pretty nice format to work with.

Here is a BRP format cad file which is pretty solid.

85526-3

And here is an example measurement in on this BRP model.  All the anchor points and such work, so it is very easy to do measurements and that sort of thing...



Luckily since FreeCAD and it supporting libraries are open source I have been able to have a poke through their code and have been able to 'fix' the issues with the SVG export and the DXF export for the most part.  Neither of them are working as well as I would like unfortunately.  The SVG will only import as a drawing instead of a geometry, so it is pretty useless in my opinion.

The DXF format imports correctly as a cad file, but for some reason it messes up "some" of the fillets.  WTF?  Why would it mess up some and not others?  If I just export the drawing from the FreeCAD UI and reimport it does the same thing, so something is messed up with the import/export functionality for this library.  So close...  :(  Even still, it only imports as a final drawing, not with the tree of the different components that make up the drawing, so that is annoying...

85524-5

So long story short.  I have not forgotten about this project, actually, I have spent WAY too much time on it recently.  The exporting stuff is pretty frustrating if I am honest.  I will probably just say 'enough with it' for now and just offer the BRP drawings to start with and we will go from there.  I need to change the air a bit or I will get too frustrated with the project and that will not help me move things forward...

On the bright side, I have been working a lot on the web UI and should have something together soon.  I have taken this opportunity to dig into Tornado a non-blocking IO python web framework.  If this tool becomes popular I need to have something in place which will allow me to scale the processing across multiple cores as well as not block requests when the plates are being processed.  Since all the code is in python I wanted to keep it in python (for now), so I figured I would give Tornado a shot.  I like its approach and I have worked with these types of frameworks enough that I should be able to pick it up in a day or two.

Anyway, thats my status update for today.  Don't tell my wife I am working over the holiday or she will have my head.  :P

Offline MOZ

  • KING OF THE NEWBIES
  • * Maker
  • Posts: 3966
  • Location: Jo'burg
  • Busy making stuff
Re: swill's plate building tool
« Reply #144 on: Sun, 28 December 2014, 14:48:52 »
The visualizations are wicked!

Regarding the export, I would really recommend figuring out when you can on how to export to SVG and DWG/DXF as a bare minimum as those are the two most popular, even if it is one single drawing and not in different components.

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #145 on: Sun, 28 December 2014, 15:33:40 »
The visualizations are wicked!

Regarding the export, I would really recommend figuring out when you can on how to export to SVG and DWG/DXF as a bare minimum as those are the two most popular, even if it is one single drawing and not in different components.
I know. Which is why I have been battling with this for almost 2 weeks now. :(

Offline MOZ

  • KING OF THE NEWBIES
  • * Maker
  • Posts: 3966
  • Location: Jo'burg
  • Busy making stuff
Re: swill's plate building tool
« Reply #146 on: Sun, 28 December 2014, 16:24:18 »
Hmmm. I've only just begun Python, so I don't know how much I can help. Are there other python developers here who could perhaps have a look.

Give it a break for a while, enjoy the holidays, if you must work on this project, then work on the frontend as you have.

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #147 on: Sun, 28 December 2014, 16:50:23 »
Hmmm. I've only just begun Python, so I don't know how much I can help. Are there other python developers here who could perhaps have a look.

Give it a break for a while, enjoy the holidays, if you must work on this project, then work on the frontend as you have.
Ya. I am going to focus on the front end and getting everything in place. I can export about 6 or so types successfully, so I can always just start with that.

I am looking to see if I can find other cad related command line conversion tools. I think openscad has some command line conversion functionality and I can export to native scad format, so that might be a way for me to get the files in those formats.

I will move on for now and revisit it with a fresh set of eyes once everything else is in place.

Thanks for all your involvement and motivation, it helps.  :)

Offline joey

  • Posts: 1890
  • Location: UK
Re: swill's plate building tool
« Reply #148 on: Sun, 28 December 2014, 17:09:08 »
Those three.js visualisations are nice.

Offline swill

  • * Elevated Elder
  • Thread Starter
  • Posts: 3317
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: swill's plate building tool
« Reply #149 on: Mon, 29 December 2014, 23:43:44 »
Alright, making progress on the web UI for making this public.  Some of this is implemented, but right now most of it is just themed on the page and not wired into the actual plate builder yet.  One step at a time...

Speaking of steps, here are the steps so far...

Step 1. Load the page and see what your options are...

85785-0


Step 2. Fill in the form according to the plate you want to generate and kick off the build...

85787-1


Step 3. View the resulting CAD drawing and download it...  All of your settings will remain on the page, so if it is not perfect, you just expand the configure section, tweak the settings and rebuild...

85789-2

Yes, I know, I am only offering the BRP format for download right now.  I will work on adding additional download formats once I have everything else working.

If you are curious, this plate is for this layout: http://www.keyboard-layout-editor.com/#/layouts/091af7581f5647094c35386ccdf55d0d

I will be adding the drawings for the additional layers of the sandwich case as well, so the bottom plate as well as closed and open layers.  An open layer is a layer that will allow a usb plug to go  through the layer.  The location and size will be configurable.  You will need to determine how many of each layer you want to use for the sandwich case based on the thickness of the material and the look you are going for.  More to come...

Slowly getting somewhere, let me know if you have feedback...