easyw / kicad-3d-models-in-freecad

kicad 3d models in freecad
GNU General Public License v2.0
134 stars 86 forks source link

The generator directory is a mess. How should we reorganize it? #28

Closed poeschlr closed 7 years ago

poeschlr commented 7 years ago

@easyw, @SchrodingersGat, @Shackmeister, @DASFrank, @metacollin: How should the generators be organized. For me 3 options come to mind: (sorted from most effort to least effort.)

Option 1: Go for depth option1

Option 2: My current effort. A bit of depth but also a lot of directories in the root folder. option2

Option 3: Focus on a uniform repo Effort by Oliver (as i understand it. I might have interpreted it wrong.) This is the solution that creates the least amount of work. option3

I vote for option 1 because i think it is the most future proof. (It will work even if we have 10 times the current generator scripts.) Option 2 generates nearly the same amount of work as option 1 does. (Still has a cluttered root directory) Option 3 could be a quick and dirty fix to get a uniform repository.

Any other suggestions?

easyw commented 7 years ago

@poeschlr, @SchrodingersGat, @Shackmeister, @DASFrank, @metacollin I was thinking of something like that: git-structure The structure will be similar to github.com/KiCad pretty repo and when a family script generator is added, only one dir will be added to the repo. In case of complex sub-models (i.e. JST connectors) the main generator DIR could have sub-dirs. Output dir should be maintained empty on-line, but its structure is useful to test and generate models locally. The reorganizing would be very easy but the result would be much cleaner than now... What do you think?

poeschlr commented 7 years ago

@easyw is my interpretation correct that what you suggest is very similar to option 2 but with the output directory moved to a separate directory within the root directory? By the way i like the mention of the _tools folder. I would do this this regardless of how the rest of the repo is organized.

SchrodingersGat commented 7 years ago

Whichever way we go, we need to reduce the amount of duplicated files that are floating around. Currently it is a nightmare for maintenance.

e.g. a single license source script that gets copied into each file.

There's also much duplication of code which my PR https://github.com/easyw/kicad-3d-models-in-freecad/pull/24 tries to address.

The other thing to address is naming convention. Currently the different scripts have random naming and there is no need to have multiple .sh / .bat files that just serve to pass different arguments through...

easyw commented 7 years ago

e.g. a single license source script that gets copied into each file.

the new add_license.py is called with default license or with a custom one which is a variable in the main script

The other thing to address is naming convention

about naming convention we could have for main files:

poeschlr commented 7 years ago

Looks good

create_model.bat(sh) 'model_name' or 'all'

This means i need to change my scripts. (Currently i'm expecting filter=model_name or filter= one could also use something like filter=*01x02\ which generates all 2 pol connectors.) But this is easily done.

regarding the cq_helpers.py script: I need to play around a bit with that. currently i have a copy of it in all cq_models directories. I need to find a way to have a different python path for when the model is generated as standalone in the cadquery workbench and when it is generated from the export scripts. (I'm sure there is a way. I was lacy when i made my last cleanup and i wanted to generate my models.) I will look into this stuff today.

easyw commented 7 years ago

@poeschlr @SchrodingersGat I just started a refactory of the structure... ATM I've done it for resistors_SMD... the process to move the scripts to the new structure is very easy ... I'm going to move all the scripts gradually... Maurice

easyw commented 7 years ago

capacitors_SMD done 😸

easyw commented 7 years ago

capacitors_radial_SMD done :grinning: capacitors_tantalum_SMD done :blush: QFN_packages done :sleeping:

easyw commented 7 years ago

DIP_packages done 😸

SchrodingersGat commented 7 years ago

🥇

easyw commented 7 years ago

GullWings QFP_SOIC_SSOP_TSSOP_SOT refactored 😸

easyw commented 7 years ago

Pin Headers, Box Headers, Capacitors Radial THT completed! Only @poeschlr model scripts need to be slightly refactored to point to _tools and to generate in _3Dmodels sub dir ...

easyw commented 7 years ago

@poeschlr @SchrodingersGat you may consider useful this folder: https://github.com/easyw/kicad-3d-models-in-freecad/tree/master/cadquery/FCAD_script_generator/WIP I added some WIP scripts... 1) option to generate molded QFN, and then molded BGA molded-qfn 2) option to load footprint beside the 3D generated model to easily check the result for all the family (latest kicad StepUp Mod 4.1.2.8 needed) molded-qfn-footprint

easyw commented 7 years ago

cleanup completed :)