Enhancements to biplanar coil workflow, optimization robustness, and manufacturable outputs (STL/Gerber + tube visualization)#82
Conversation
|
Hello and thank you for the PR. |
|
I presume that you used AI assistance to generate or assist with these changes. Please can you provide some details, especially which models where used, and the level of guidance that you provided. |
kev-m
left a comment
There was a problem hiding this comment.
Thank you for your contributions.
Unfortunately, I can not accept the PR as provided.
Please can you take care of the following and resubmit:
- Exclude all non-project binary files from the commit (
.DS_Store) - Move helpers or plotting-only modules out of the sub_functions module into a more appropriate place, e.g.
pyCoilGen\plottingorpyCoilGen\helpers. - Ensure that all functions used by the main calling path are documented with Google-style docstrings (see the
CONTRIBUTING.mddocument). - Provide updated project documentation in
docs\source, describing all new parameters and functionality. This is critical to help users understand the changes and new functions that you are introducing. - Ensure that all modules in
pyCoilGen\sub_functionsare single-function (the current project convention). - Any tests or verification scripts (such as
pyCoilGen/sub_functions/test_stl_generation.py) are in an appropriate place, and that all referenced resources are included in the PR.
yes, I used chatgpt 5.4 and 5.3 for code generation of certain aspects related to wire extraction and stl printing in particular. These code snippets went through multiple iterations and debugs. I am not sure how I would answer your question on the level of guidance but I would put it down as atleast 30 to 40 iterations per snippet to ensure the correct libraries and bug free/minimized code was generated and pruned. I did prune code subsequently to fit it into the pycoilgen frramework as well. Ofcourse, I need to cleanup/refactor some of the code still - especially related to imports and docstrings. |
|
|
Hello! Thank you for the time and enthusiasm you've put into this contribution. It's great to see interest in expanding the functionality of pyCoilGen. I've reviewed the PR, and while the underlying ideas are interesting, I'm not able to merge it in its current state. To maintain the project's stability and ensure your work is actually usable by others, we need to bring the PR in line with the project's standards. Specifically, I'd like to see the following addressed:
Next Steps:
I'm happy to support you through these adjustments. Once the PR is tidied up and documented, I'll be in a much better position to do a final technical review for merging. |
1. Exclude all non-project binary files from the commit (.DS_Store)
2. Move helpers or plotting-only modules out of the sub_functions module into a more appropriate place, e.g. pyCoilGen\plotting or pyCoilGen\helpers.Refactored code to create single definition files and place in corresponding directories
3. Ensure that all functions used by the main calling path are documented with Google-style docstrings (see the CONTRIBUTING.md document).
4. Provide updated project documentation in docs\source, describing all new parameters and functionality. This is critical to help users understand the changes and new functions that you are introducing.
5. Ensure that all modules in pyCoilGen\sub_functions are single-function (the current project convention).The three functions are single-function implementations now:
6. Any tests or verification scripts (such as pyCoilGen/sub_functions/test_stl_generation.py) are in an appropriate place, and that all referenced resources are included in the PR.
|
|
A quick question: Are you a bot or a human? |
|
Totally human :) Nice to meet you @kev-m |
|
Hi!
Does this sound reasonable to you? Other observations:
|
|
@kev-m - I should be able to work through the changes, except mapping 4 as multiple features might be required to make one part of the workflow work. So, I might end up bunching up a couple but I will try my best to be as modular as possible. Might take me a few days to get this sorted. |

Summary
This PR introduces a set of improvements to biplanar coil design workflows, optimization robustness, and manufacturing-ready outputs in pyCoilGen.
The changes are based on extended development in my fork and aim to make the pipeline more reliable for practical fabrication (3D printing + PCB workflows) while preserving compatibility with the original architecture.
Key Contributions
1. Improved Biplanar Coil Example
Refactored and stabilized the biplanar gradient example
Improved handling of:
Eliminated failure modes where one plate would generate empty or invalid geometry
Impact:
The biplanar example is now a reliable reference for users working on planar gradient coils or similar hardware.
2. Optimization Refinements
Improved robustness of the optimization pipeline:
More stable convergence behavior in practical scenarios
Impact:
Improves reproducibility and reduces manual intervention when generating coil layouts.
3. Manufacturing-Ready Gerber Output
Added/updated support for:
Ensures outputs are directly usable for PCB manufacturing workflows
Impact:
Bridges the gap between simulation and real-world PCB fabrication.
4. Robust STL Generation for 3D Printing
Reworked STL generation pipeline to:
Improved handling of:
Impact:
Users can now directly move from coil design to 3D printing (e.g., groove plates, formers) without extensive post-processing.
5. Tube-Based Wire Visualization
Introduced tube-based 3D visualization of wire paths:
Can be reused for:
Impact:
Provides an intuitive and physically meaningful representation of coil windings.
6. Geometry & Scaling Fixes
Fixed inconsistencies between:
Ensured consistent scaling across:
Impact:
Eliminates a major source of fabrication errors.
7. Pythonic Input STL Generation
Replaced the previous approach of storing static STL files under
data/pyCoilGenData/Geometry_Datawith a fully Pythonic geometry generation workflowInput geometries are now:
Eliminates reliance on pre-generated STL assets
Impact:
Improves transparency, reproducibility, and flexibility of the geometry pipeline, making it easier for users to define and customize coil form factors directly in code.
Implementation Notes
Changes are largely modular and focus on:
Existing APIs are preserved where possible
New logic is primarily integrated into:
Testing
Validated using:
Confirmed:
Motivation
The original pyCoilGen provides a strong foundation for coil design, but bridging the gap to fabrication-ready outputs required additional robustness in geometry handling and export workflows.
This PR aims to:
Future Work (Optional)
Request for Feedback
I would especially appreciate feedback on:
Here’s a drop-in “Before vs After” section you can paste directly into your PR description:
Before vs After section follows
Before
Biplanar example could produce:
Optimization occasionally resulted in:
STL export:
Gerber output:
Geometry inputs:
data/GeometryVisualization:
After
Biplanar example is:
Optimization:
STL export:
Gerber output:
Geometry inputs:
Visualization:
Net Effect
This PR transitions pyCoilGen from a primarily design/prototyping tool to a more end-to-end pipeline that supports:
with significantly improved robustness and reproducibility.