You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
with some of the below dump of exploratory code being useful, its half translated from c++ ie the pointers dont work:
camera=viewer.getSoEventManager().getCamera()
cam_pos=camera.position.getValue().getValue()
direction= (0, 0, -1)
orient=sdirection*=orientfocal_point=cam_pos+camera.focalDistance.getValue() *direction# rotation_dist = camera.focalDistance.getValue() * coin.SbVec3f(0, 0, 1)# new_rot_cen = orient * = rotation_distfront_orient=np.sqrt(2) /2orientation= (front_orient, 0, 0, front_orient)
# // Distance from rotation center to camera position in camera coordinate systemrotationCenterDistanceCam: SbVec3f=camera.focalDistance.getValue() *SbVec3f(
0, 0, 1
)
# // Set to the given orientationcamera.orientation=orientation# // Distance from rotation center to new camera position in global coordinate systemnewRotationCenterDistance: SbVec3f=camera.orientation.getValue().multVec(
rotationCenterDistanceCam, newRotationCenterDistance
)
# // Reposition camera so the rotation center stays in the same place# // Optionally add translation to move to centercamera.position=focal_point+newRotationCenterDistance# vprt = coin.SbViewportRegion()# action = coin.SoGetBoundingBoxAction(vprt)# root.getBoundingBox(action)# action.getBoundingBox().getSize().getValue()
With the above you need to remvoe the rotate=True from the viewer and the rotate argument completely as mentioned in #3235
Alternative solutions
leave as is, it does work.
Additional context
This may lead to us being able to specify the viewing angle say for an autogenerated image in future.
The text was updated successfully, but these errors were encountered:
Description of issue / requirement to address
Our freecad cad viewer has a slight hack in it that rotates the CAD instead of the camera of the viewer
Proposed solution
The camera can be accessed here:
bluemira/bluemira/codes/_freecadapi.py
Line 2407 in 4eb7987
with some of the below dump of exploratory code being useful, its half translated from c++ ie the pointers dont work:
With the above you need to remvoe the rotate=True from the viewer and the rotate argument completely as mentioned in #3235
Alternative solutions
leave as is, it does work.
Additional context
This may lead to us being able to specify the viewing angle say for an autogenerated image in future.
The text was updated successfully, but these errors were encountered: