kicad-lib-committers team mailing list archive
-
kicad-lib-committers team
-
Mailing list archive
-
Message #00558
Re: FCAD script generator.
-
To:
kicad-lib-committers@xxxxxxxxxxxxxxxxxxx
-
From:
Wayne Stambaugh <stambaughw@xxxxxxxxx>
-
Date:
Tue, 2 Oct 2018 17:31:17 -0400
-
Autocrypt:
addr=stambaughw@xxxxxxxxx; prefer-encrypt=mutual; keydata= mQGiBEM0hxQRBAC2fNh3YOVLu1d5GZ0SbrTNldGiGnCJPLqzEnqFX9v6jmf33TMt6EmSLkl6 Wtfkoj0nVwKxcYmJkA8DX0QAokBkwNIzhSsBzQvthBLIk/5LnPVVKrEXOcL4mUyH1doKlkaE slgJozNa6Av+oavcvD02o1zJOloBbaHlNlyRt7fKswCgtIFlVjWggVH/15KfWk+Qo5JVPbME AIUBAQyL2OAx0n60AWec2WHnO9buHuG0ibtICgUMkE+2MRmYyKwYRdyVwGoIUemFuOyHp0AJ InX4T+vy2E7vkwODqjtMLfIoRkokW74Fi4nrvjlhOAw/vdq/twLbAmR9MOfPTpR4y7kQy1O2 /n+RkkRvh26vTzfbQmrH7cBJhk6aA/9Uwvu3E4zNJgHVZeS0HyWtmR1eOPPRbnkPgJTToX5O KMKzTJI/FX6kT7cFoCamitHrW3BJP4Dx+cMMsa47EGxqVTdbVJ4LjogsXTXxb+0Fn1u4zBdx x3Cer6O7+hqWy7zvpzeC6nSREjqDKa5CgHtv/GLm5uFPOmsjAsnHj2tlBrQmV2F5bmUgU3Rh bWJhdWdoIDxzdGFtYmF1Z2h3QGdtYWlsLmNvbT6IeAQTEQIAOBYhBOffs6CbblRzBkv33BtR cWlZ+CReBQJbFBS2AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEBtRcWlZ+CReMI8A nRbrLkzp7+c2f0vX7sfg4ICX8LAKAJ9uClo4uJajmZa5zZrL2nKdZlUwIrkCDQRDNIcxEAgA gCru+3/aOC6RCjpvYC72wY+d5SmHphC6yeiV2/mOumyt5MLo/Ps2GznZr11JspqFk5K/Zpvp MMLqqjDZ39+50a2iKRQFJ6NlK+hJWMmj6eJygQrCwYo3Gjc6CqfrqUv+8VSnf/i5sIZmtOVA 4ZjML18MuBvMSsNdVLFJd5HNnYb1iOECpvqdPVh/21LLCEw7MUUGGnHBhCrmk2aJe5hFmcSN g4ldBcXrgMQBwf7aMVoobXBMFDb/IENByXn0llB7Gr2IFMRmNS9/p8s/II1Yl2bTqyX4FSz8 cfn7C9KEz7faZ7wzAcpwHFC/zs3JoAjJ0IEKdNUpIwAlKMzT3CzctwADBQf/cxpG28MKyrqk nNmq/8LQLy+x6FSYXBLjxQz9BiBNYeesDZQ6J5UbL1mjpJzMa5tLZypPYo4bbGyR22hrbyDF K7m6AcVaMIJKl98g4ukMutFfAJyRDaREH5Zl/X1P4u1Z/yaAIy9mKaNbaK1/5djNJ5wCTFen TUgAp9xdc30kGkFDdLJFp5uxDY4P0vaZiZdjUCvDM3Zjv5IzpNOfxVqTUBQNUP/BnnKhkk0p DTD6s3X8S+D0rOtEBQ8K0cwERI/E8EFa8nj0TNw4e2MYGR8wg+SxqJ7z5f0zPY0bO6G9DDFB wYCqzzPWGqdAh9vA5971TAbPERtdFybhkurozp2SfYhJBBgRAgAJBQJDNIcxAhsMAAoJEBtR cWlZ+CResHUAniULLCWiT26ieRTl7N2vS6vBo/DuAJ4m7Ss/gyiW6ybTn1ctDXAUgm2QVQ==
-
In-reply-to:
<b4a6ab64-801c-788e-65a8-af2026b332d8@gmail.com>
-
Openpgp:
preference=signencrypt
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1
On 10/02/2018 03:20 PM, Rene Pöschl wrote:
> On 02/10/18 20:16, Wayne Stambaugh wrote:
>> On 10/2/2018 12:11 PM, Wayne Stambaugh wrote:
>>> On 10/2/2018 11:21 AM, Rene Pöschl wrote:
>>>> On 02/10/2018 16:24, Wayne Stambaugh wrote:
>>>>> I was playing around with the FCAD script generator project[1] in a
>>>>> failed attempt to generate a 3D model for a DC to DC converter that
>>>>> I am
>>>>> creating for a project at work and intent to push to the kicad
>>>>> libraries. Are these scripts still being used to create 3D models for
>>>>> KiCad because I cannot get anything to work correctly using the
>>>>> supplied
>>>>> documentation. If someone could point me in the right direction, I
>>>>> would appreciate it.
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Wayne
>>>>>
>>>> You did not provide the link for your [1]
>>> Sorry about that. It's the same as your [1] below.
>>>
>>>>
>>>> We currently use freecad plus cadquerry for scripting. (We no longer
>>>> use
>>>> Wings3d) The scripts can be found here under [1]
>>>>
>>>> The scripts require FreeCad 0.17 or newer. (If you disable geometry
>>>> checks then you can also use 0.15 and 0.16) Plus the cadquerry module
>>>> [2] version 0.5.2 (If i remember correctly then version 1 had problems
>>>> with the "selectors". I have not worked with these scripts for a while
>>>> and there are newer releases of cadquerry so it might be that the
>>>> problem has been fixed.)
>>> I have installed the latest version of cadquery and I see CadQuery in
>>> the workbench list in FreeCAD and when I select it I see the CadQuery
>>> menu so I'm assuming that's all good.
>>>
>>>> All of these are called from the commandline something similar to
>>>> FreeCad script_name.py parameters.
>>> That was the problem. I wasn't calling out the variant on the command
>>> line. Thanks for the tip. Once I'm done with the model I can submit
>>> the symbol, footprint, 3D models, and script changes for approval.
>>>
>>>> Scripts that i designed are also directly loadable in the cadquerry
>>>> workbench. (Examples are the molex scripts. There is a subdirectory
>>>> cq_models. Load the script via the menu item CadQuerry -> Open Script.
>>>> This way it is a lot easier to develop the script it self.) The main
>>>> script in such cases only takes care of creating all (selected)
>>>> variants
>>>> and the export process (including the addition of colours.)
>>> I don't think this is the case with the DC to DC converter script but I
>>> can get it to create the model so I'm moving it the right direction.
>>>
>>>> The best place to get further help is via an issue at that repo or on
>>>> the user forum.
>>>>
>>>> ---
>>>>
>>>> Another maybe easier option is to design your 3d file using freecad and
>>>> then use kicad stepup to export the resulting file for kicad. (It will
>>>> automatically generate the wrl and step files in the correct scaling
>>>> and
>>>> if you choose also with our standard colour scheme.)
>>> I would rather take advantage of existing script based model generators
>>> rather than create models by hand. My parametric modeling skills are
>>> weak and I really don't have a lot of free time to work on them.
>>>
>>> Thanks for the help,
>>>
>>> Cheers,
>>>
>>> Wayne
>>>
>>>> The third option is to use whatever 3d modeling program you like
>>>> (Catia,
>>>> Siemens NX, Creo, ...), export step, import that step file into freecad
>>>> and then use stepup to get the wrl/step pair for kicad. Or use the
>>>> generated step file directly. (The same works with manufacturer
>>>> supplied
>>>> 3d models. Here you might need to take a close look at the license of
>>>> such models.)
>>>>
>>>> For stepup the best place to get more info is the user forum. But i
>>>> would guess also via an issue over at its github repo: [3] Stepup
>>>> can be
>>>> directly installed using the Addon Manager of freecad (tools -> Addon
>>>> Manager) A cheatsheet can be found under [4]
>>>>
>>>> ---
>>>>
>>>> [1]:
>>>> https://github.com/easyw/kicad-3d-models-in-freecad/tree/master/cadquery/FCAD_script_generator
>>>>
>>>>
>>>>
>>>> [2]: https://github.com/jmwright/cadquery-freecad-module
>>>>
>>>> [3]: https://github.com/easyw/kicadStepUpMod
>>>>
>>>> [4]:
>>>> https://github.com/easyw/kicadStepUpMod/raw/master/demo/kicadStepUp-cheat-sheet.pdf
>>>>
>>>>
>> One more quick question. I noticed in the DC to DC converter script
>> that all of the dimensions in the are in millimeters which makes the 3D
>> model wrong scale for KiCad. Is the preferred script method to create
>> the models in millimeters then scale them for KiCad using FreeCAD or
>> scale the dimensions for kicad when creating new script models? I'm
>> finding it rather cumbersome to scale the model in FreeCAD so I was just
>> curious.
>>
>> Cheers,
>>
>> Wayne
>>
>>
>
> The script should create a 1:1 mm scale step model plus a 1/2.54 scaled
> (inch) wrl file (the same way as stepup does.)
>
> The footprint must be setup with scaling = 1 for this to work correctly.
>
> The scaling happens via the scale parameter in this function call on
> line 819: colored_meshes = expVRML.getColoredMesh(Gui, export_objects ,
> scale)
>
> The scale variable is set a few lines above to 1/2.54
>
> https://github.com/easyw/kicad-3d-models-in-freecad/blob/581bab3ea182ce68909fa83561f92caf6e9c8ea8/cadquery/FCAD_script_generator/Converter_DCDC/main_generator_Converter_DCDC.py#L819
>
How do you get the script to create the vrml and step files? When I run
the script like `freecad main_generator_Converter_DCDC.py variant, the
only thing that happens is freecad is launched with the model of the
variant. I have to save the freecad file and export the vrml and step
files of the model which are not scaled.
Follow ups
References