chdominguez / Atomic

Modern molecular visualizer for macOS and iOS
MIT License
27 stars 2 forks source link

Distances and angles between atoms can be edited manually or by slider #14

Closed chdominguez closed 2 years ago

chdominguez commented 2 years ago

When selecting 2 atoms, a slider above the distance can ve moved to edit the distance between the atoms.

When selecting 3 atoms, the slider edits the angle between them.

Methods added to MoleculeRender: -editDistance() -editAngle() -editDistanceOrAngle()

When the distance/angle textfield is edited, editDistanceOrAngle gets called and modifies the positions of the vectors depending on the amount of selected nodes. 2 for the distance (editDistance()), 3 for the angle (editAngle()).

SCNVector3 has brand new methods:

SCNVector3 has new computed properties: -dx, dy, dz. Double counterparts of the vector x, y and z variables.

New init to CGFloat to initialize it with a string. To be used when calling UFloat() as a typealias for Float and CGFloat.

General extension to Double to convert between degrees and radians