horizon-eda / horizon

Horizon is a free EDA package
https://horizon-eda.org/
GNU General Public License v3.0
1.13k stars 83 forks source link

imp package: add bottom-up STEP projection #721

Closed eqvinox closed 1 year ago

eqvinox commented 1 year ago

When drawing packages, while the top-down STEP projection is useful, it can in some cases be just entirely silly... for example QFN parts in a top down view are just the package outline.

Add a bottom-up projection where you actually see useful things.

Note that this is not a rotation, it's a reversal of the Z axis. This doesn't seem to be possible in gp_Ax2 since it turns around the handedness of the coordinate system. Hence some transform shenanigans on this.

Bonus points for gp_Trsf trying to be clever and converting the (1,1,-1) matrix into a "(-1,-1,1) + scale -1" matrix, the scale part of which is then later ignored by default in HLRAlgo_Projector... so suddenly it's an XY flip :'(


I feel like OpenCASCADE made this much harder than necessary :cry: … took a bunch of whacking things with a hammer to get this going.

For reference here's top-down and bottom-up for a USB connector, with the STEP model moved to the side to make it more obvious:

Top down (only option before this PR)

top down

Bottom up (added by this PR)

bottom up

eqvinox commented 1 year ago

Here's a QFN for comparison (again 3D model moved to make it easier to see), where the top-down view is in fact just a useless rectangle (and a company logo :laughing:)

Note that the pin 1 marker is in the right place — because the 3D model is not rotated, it's mirrored in Z axis / projection direction reversed / however you want to call it.

horizon_bottom_up_qfn

carrotIndustries commented 1 year ago

Neat! As with the other PR, I'll merge this after the next release is out.