feat: add coilToTikz electrical-schematic generator + topology mocks#11
Open
gpitel wants to merge 1 commit into
Open
feat: add coilToTikz electrical-schematic generator + topology mocks#11gpitel wants to merge 1 commit into
gpitel wants to merge 1 commit into
Conversation
Port of the MagneticDesigner calc/schematic.py generator to JS: builds an electrical-schematic tikzpicture from a MAS coil (functionalDescription / isolationSide / connections), grouping windings by isolation side and drawing every shared node as a parallel vertical rail. Output is plain TikZ (decorations.pathmorphing) that compiles through the /process_latex endpoint. Verified byte-identical to the Python reference across 8 topology mocks; mockCoils.js bundles those mocks for the playground. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> (cherry picked from commit 551e4a3)
44b784b to
1822997
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
assets/js/coilToTikz.js— a pure function that turns a MAS coil (functionalDescription/isolationSide/connections) into an electrical-schematictikzpicture, plusassets/js/mockCoils.jswith 8 topology fixtures. Two new files, no changes to existing code.It groups windings by isolation side, draws each as a coil across the core, and renders every shared node (incl.
Blindjunctions) as a parallel vertical rail with junction dots. Output is plain TikZ (decorations.pathmorphing) that compiles through the backend's/process_latex_svgendpoint. Verified byte-identical to the MagneticDesignerschematic.pyreference across all 8 topology mocks.Examples — input MAS coil → rendered schematic
1.
basic— primary + secondary, no blind connection2.
star_b1— three primaries commoned at blind junction B13.
blind_chain— primaries in series via B1, B2 (parallel rails)Notes
🤖 Generated with Claude Code