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

Add unique canonical name per connector #38

Open
follower opened this issue Jun 27, 2017 · 3 comments
Open

Add unique canonical name per connector #38

follower opened this issue Jun 27, 2017 · 3 comments
Assignees

Comments

@follower
Copy link
Contributor

follower commented Jun 27, 2017

Initially can be of the form <board?>.<connector>.<pin> but since it's desired to expose this as a JS property it may need to changed/exposed as <connector>_<pin>, <Connector><Pin> or similar.

@follower follower self-assigned this Jun 27, 2017
@follower
Copy link
Contributor Author

Note that the separator character chosen may appear in a connector or pin name (so far I've seen $ and it may be that _ is used too), so ideally we want to pick a separator that isn't valid as an Eagle name or escape the character if it is used.

@follower
Copy link
Contributor Author

follower commented Jul 3, 2017

This should be sufficient to create the desired canonical name (sans board name):

                        connector.userData.drill = drills[ i ];
                        if ( drills[ i ].elementParent ) {
+                               connector.name = drills[ i ].elementParent.getAttribute("name") + "." + drills[ i ].getAttribute("name");
                                connector.userData.element = drills[ i ].elementParent;
                        }

produces a name like so:

JP8.4

Will work on patching the library with this now.

@follower
Copy link
Contributor Author

The generated names can be viewed in the console via:

brd.connectHoles.forEach(function(_) {console.log(_.name)})

(Note that every second connector has no name, as they're the bottom-side connectors.)

(I looked into demoing with a tool-tip for each hole but as there seems to be no standard Three.js tool-tip implementation I've just stuck with the console demo for now.)

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

No branches or pull requests

1 participant