Omniblox / Eagle-Loader

THREE.js Loader for EAGLE .brd files
https://omniblox.io
MIT License
19 stars 4 forks source link

Improve connector visualisation #7

Open follower opened 8 years ago

follower commented 8 years ago

Connectors have both a position and a direction attribute but the current visualisations (using spheres) only clearly show the position attribute.

Since understanding the direction attribute seems to be important in understanding how connectors work it seems like it would be a good idea to visually indicate the direction of a connector.

(My initial mis-understanding about connector direction was that I thought a connector's direction was always perpendicular to the object to which it was attached (e.g. the geometric normal of PCB) but this is not the case for the board loader.

This was discovered by using a THREE.ArrowHelper to visualise the direction of the connector. The ArrowHelper visualisation shows that the component connector direction runs along (i.e. parallel to) the surface of the board.)

I feel like a notched disc/extruded triangle may be a clearer connector visualisation or, at least, adding an arrowhead/cone that protrudes from the current sphere.

I've experimented with some possible direction visualisation approaches but have uncovered some wider issues:

follower commented 8 years ago

Here are two visualisation variations:

connector-visualise-direction--approach-1

connector-visualise-direction--approach-2

(Note that, in this case I think the direction indicator has been rotated an additional 90 degrees from the correct direction due to this experiment not accounting for a change in how its drawn.)

(Note also that the wireframe version of the sphere can also partially indicate the direction (related to the value of this.marker.matrixAutoUpdate).)

follower commented 8 years ago

Due to: the interrelated issues; the fact that I now understand the connector direction aspect; and, have a way to manually debug connector direction visualisation (see below) I'll put the connector visualisation aside for now and return to component model loading/display.

The following will display an arrow for the connector direction:

    ah = new THREE.ArrowHelper(connector_mesh.getWorldDirection(), connector_mesh.getWorldPosition(), 6, 0x99cc88, 5, 2)                                                                         
    scene.add(ah);                                                                        
follower commented 7 years ago

I've realised there seem to be a couple of other factors at play here too: