Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support arc tracks (GenericJSON) #230

Closed
wants to merge 7 commits into from

Conversation

Funkenjaeger
Copy link
Contributor

Support for arc tracks with GenericJSON parser, since Eagle/Fusion 360 Electronics are capable of curved traces.

Copy link
Member

@qu1ck qu1ck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, some formating nits.

InteractiveHtmlBom/web/render.js Outdated Show resolved Hide resolved
@qu1ck
Copy link
Member

qu1ck commented Feb 28, 2021

Clicking to highlight will break. Need to handle arcs there too.
in render.js netHitScan()

@Funkenjaeger
Copy link
Contributor Author

Good point, I had sort of forgotten about the click-to-highlight capability. That was a fun little Sunday morning math quiz, but it seems to be working now.

For reference: Eagle/Fusion arc angles (internally) are in the range [0.0, 719.9], following the usual mathematical convention where angle is measured counterclockwise from the positive X axis. Since the Canvas API evidently follows the opposite angle convention, in my Eagle script I simply negated both angles so in the JSON they're always in the range [-719.9, 0.0]. Those values render the arcs in the canvas just fine as-is, but I had to do modulo arithmetic within pointWithinDistanceToArc() when checking proximity. I think all that logic should also work for values outside that numerical range (assuming Kicad will likely be different) but I haven't personally tested that.

(side note: a comment in DATAFORMAT.md indicating the angle convention wouldn't hurt)

InteractiveHtmlBom/web/render.js Outdated Show resolved Hide resolved
InteractiveHtmlBom/web/render.js Outdated Show resolved Hide resolved
InteractiveHtmlBom/web/render.js Outdated Show resolved Hide resolved
InteractiveHtmlBom/web/render.js Outdated Show resolved Hide resolved
InteractiveHtmlBom/web/render.js Outdated Show resolved Hide resolved
InteractiveHtmlBom/web/render.js Outdated Show resolved Hide resolved
@qu1ck qu1ck closed this in 2ad2be4 Mar 1, 2021
@qu1ck
Copy link
Member

qu1ck commented Mar 1, 2021

Thanks for your contribution. I squashed your commits with a few fixes I made while testing with kicad.
Updated DATAFORMAT too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants