For the rotation wheel, I need to get the size of the wheel in the scene graph.
Is there any function that can retrieve that info like we have in FreeCAD?
This is not related to a mouse-click .. So no action should be required for getting that info.. Giving the SoSeparator to that function should return the size-dimensions.
XMax , YMax and ZMax ?
I need to know these dimension to calculate the center and later use that to calculate the angle of rotation with the movement of the mouse pointer. I made a similar wheel before but is not accurate.
Thanks
COIN3D get Boundary box or length (size) of COIN object ?
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
COIN3D get Boundary box or length (size) of COIN object ?
Design456 Direct Modeling. Coin3D GUI Toolkit. Objects get simplified.
https://github.com/MariwanJ/Design456 - https://wiki.freecadweb.org/Design456_Workbench
https://www.youtube.com/watch?v=6agcHPd ... utbTDH93m_
https://github.com/MariwanJ/Design456 - https://wiki.freecadweb.org/Design456_Workbench
https://www.youtube.com/watch?v=6agcHPd ... utbTDH93m_
Re: COIN3D get Boundary box or length (size) of COIN object ?
seems to be difficult to answer
Design456 Direct Modeling. Coin3D GUI Toolkit. Objects get simplified.
https://github.com/MariwanJ/Design456 - https://wiki.freecadweb.org/Design456_Workbench
https://www.youtube.com/watch?v=6agcHPd ... utbTDH93m_
https://github.com/MariwanJ/Design456 - https://wiki.freecadweb.org/Design456_Workbench
https://www.youtube.com/watch?v=6agcHPd ... utbTDH93m_
Re: COIN3D get Boundary box or length (size) of COIN object ?
Thank you very much .. I think you saved my eveningkwahoo wrote: ↑Fri Dec 03, 2021 4:57 pm Have you seen SoBBox class?
https://www.openinventor.com/reference- ... b_box.html
https://developer.openinventor.com/User ... g_Box.html
It returns https://coin3d.github.io/Coin/html/classSbBox3f.html
I was planning to search and read lot of api.
Yesterday, I tried to understand how I use those functions but I failed. The examples given in the pages you told me helps to understand.
Look at my code for both center and boundary box max, min .. I hope it is correct.
Code: Select all
def getWidgetsCentor(self):
"""[Get Center of the Widget]
Returns:
[App.Vector]: [Return a vector represents the centor of the widget]
"""
viewPort = coin.SbViewportRegion()
BoundaryAction = coin.SoGetBoundingBoxAction(viewPort)
BoundaryAction.apply(self.w_wdgsoSwitch)
center = BoundaryAction.getCenter()
return App.Vector(center[0], center[1], center[2])
def getWidgetsBoundary(self):
"""[Retrive the Min/Max size of the 3D coin object, by returning the Min vector and Max vector]
Returns:
[Tuple]: [Two vectors first is for the Min Boundary, second is for the Max Boundary]
"""
viewPort = coin.SbViewportRegion()
BoundaryAction = coin.SoGetBoundingBoxAction(viewPort)
BoundaryAction.apply(self.w_wdgsoSwitch)
Boundary = BoundaryAction.getBoundingBox()
BoundMax = coin.SbVec3f()
BoundMin = coin.SbVec3f()
Boundary.getMax(BoundMax)
Boundary.getMin(BoundMin)
return ([App.Vector(BoundMin[0], BoundMin[3], BoundMin[2]),
App.Vector(BoundMax[0], BoundMax[1], BoundMax[2])])
If you are able to confirm the functions are correct, I will mark this thread as SOLVED .. please let me know.
Thanks .
Design456 Direct Modeling. Coin3D GUI Toolkit. Objects get simplified.
https://github.com/MariwanJ/Design456 - https://wiki.freecadweb.org/Design456_Workbench
https://www.youtube.com/watch?v=6agcHPd ... utbTDH93m_
https://github.com/MariwanJ/Design456 - https://wiki.freecadweb.org/Design456_Workbench
https://www.youtube.com/watch?v=6agcHPd ... utbTDH93m_
Re: COIN3D get Boundary box or length (size) of COIN object ?
I'm sorry but I cannot. I've never used that class.
Re: COIN3D get Boundary box or length (size) of COIN object ?
np
You helped me much .. thank you
I will be using it so I will know ..
You helped me much .. thank you
I will be using it so I will know ..
Design456 Direct Modeling. Coin3D GUI Toolkit. Objects get simplified.
https://github.com/MariwanJ/Design456 - https://wiki.freecadweb.org/Design456_Workbench
https://www.youtube.com/watch?v=6agcHPd ... utbTDH93m_
https://github.com/MariwanJ/Design456 - https://wiki.freecadweb.org/Design456_Workbench
https://www.youtube.com/watch?v=6agcHPd ... utbTDH93m_
Re: COIN3D get Boundary box or length (size) of COIN object ?
First day working on the Face manipulator
Design456 Direct Modeling. Coin3D GUI Toolkit. Objects get simplified.
https://github.com/MariwanJ/Design456 - https://wiki.freecadweb.org/Design456_Workbench
https://www.youtube.com/watch?v=6agcHPd ... utbTDH93m_
https://github.com/MariwanJ/Design456 - https://wiki.freecadweb.org/Design456_Workbench
https://www.youtube.com/watch?v=6agcHPd ... utbTDH93m_