-
Notifications
You must be signed in to change notification settings - Fork 0
Components
Components are stored in their own repository here: https://github.com/Trinkets/Components
There are two formats, OBJ and STEP, more information on each format is listed below. Only the OBJ files are posted publicly in mesh form. The STEP files are available in the repository for collaborators.
Components for Wire are stored in OBJ files. OBJ files can contain multiple meshes (known as objects in OBJ parlance) with names. We give a name to each terminal of a component based on its pin number/name in the data sheet. Typically this is terminal_1, terminal_2 etc.. When the OBJ file is created the object name is added like so:
o terminal_1
v 4.220871925354004 18.00123023986816 26.48273468017578
v 5.970871925354004 18.00123023986816 26.48273468017578
v 4.220871925354004 18.00123023986816 32.21478652954102
v 4.470871925354004 18.00123023986816 32.21478652954102
Currently components are being designed by pcb-3d.com. They are delivered as STEP files. The STEP files need to be converted into OBJ meshes. This is currently done using Rhino.
- Open the STEP file in Rhino. Use these settings for the importing. Join surfaces is especially important.
- Edit > Select Objects > All Objects
- Edit > Explode - Do this twice or until there are only polysurfaces in the scene (no block instances)
- Select a terminal and check in the object properties panel that it is a polysurface and that it's name is correct (e.g. terminal_1)
- Edit > Select Objects > All Objects
- File > Export
- Select OBJ format and use these settings
Conversion of a batch of STEP files can be done in Rhino using the script available here: https://github.com/Trinkets/Components/blob/master/Code/Rhino/ConvertSTEPtoOBJ.py
NOTE: Python scripting is super buggy on mac, using windows is recommended
- First run the manual process above once so that the import/export defaults are correct
- Open the script and change the myPath variable to point to the folder where your STEP files are located
- Run the script from Rhino
- You should see lots of flashing models and the the OBJs will be saved to the STEP directory
An example Solidworks file prepared for this format is available here.
STEP files exported from SolidWorks need to have the MANIFOLD_SOLID_BREP field with the "terminal_1” etc naming. The easiest way to check is to look at the STEP file in a text editor.
Notes on how to name the components correctly will be added by Tim.
Rendering of component thumbnails is also done in Rhino. The script below can batch render a set of OBJ files. Again windows is recommended. https://github.com/Trinkets/Components/blob/master/Code/Rhino/RenderThumbnails.py
The JSON file listing all the components is found here: https://github.com/karldd/Wire/blob/development/public/components/components.json This is currently a work in progress, but the basic fields are as follows:
"npnTransistor": {
"name": "NPN Transistor (BJT)",
"description": "A bipolar junction used for amplifying or switching electronic signals. This type of BJT (Bipolar Junction) needs a positive current in the base terminal.",
"tags": [
"transistor",
"logic"
],
"package": [
{
"name": "TO-92",
"model": "./components/obj/IC_TH_TO-92.obj",
"image": "./components/img/IC_TH_TO-92.png"
},
{
"name": "TO-220-3",
"model": "./components/obj/IC_TH_TO-220-3.obj",
"image": "./components/img/IC_TH_TO-220-3.png"
}
]
}
Component categories and descriptions are derived (more or less) from Circuits.io components.
User Scenarios contribute here to help explain how people will use Wire