Model origin
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
Model origin
Hi
Is there a way to show origin in model window (coordinate [0, 0, 0]).
This is kinda necessary for me.
Regards,
Petar Perisin
Is there a way to show origin in model window (coordinate [0, 0, 0]).
This is kinda necessary for me.
Regards,
Petar Perisin
Re: Model origin
Is it this what you need?
Code: Select all
from pivy import coin
type=coin.SoType.fromName("SoAxisCrossKit")
axis=type.createInstance()
Gui.ActiveDocument.ActiveView.getSceneGraph().addChild(axis)
Re: Model origin
Yes. Thank you very much
Re: Model origin
Hi,
I see that this origin has 3 arrows that are 10cm long.
Is there a way to make origin arrows bigger or smaller, based on the zoom level
Regards
Petar Perisin
I see that this origin has 3 arrows that are 10cm long.
Is there a way to make origin arrows bigger or smaller, based on the zoom level
Regards
Petar Perisin
Re: Model origin
I guess what you mean is a axis cross of fix size independent of the zoom level. So try out this:
You can play with the scaleFactor.
Code: Select all
from pivy import coin
axisCross=coin.SoType.fromName("SoShapeScale").createInstance()
axisCross.setPart("shape", coin.SoType.fromName("SoAxisCrossKit").createInstance())
axisCross.scaleFactor.setValue(1.0)
Gui.ActiveDocument.ActiveView.getSceneGraph().addChild(axisCross)
Re: Model origin
Yes.
That's it. Thank you very much

That's it. Thank you very much

Re: Model origin
Hi,
Sorry for asking a lot, but I have scaled entire cursor to scale 0.4, and size is good, only the lines of arrows are too thin.
So, my final question is - is it possible to make arrows a bit wider?
Regards
Petar Perisin
Sorry for asking a lot, but I have scaled entire cursor to scale 0.4, and size is good, only the lines of arrows are too thin.
So, my final question is - is it possible to make arrows a bit wider?
Regards
Petar Perisin
Re: Model origin
Just as a note, you can create quite complex widgets with pivy/coin... I think this cross widget is a default one Werner or Jürgen did for FreeCAD and I'm not sure how far it is customizable, but you can easily build a totally custom one. Have a look here:
http://sourceforge.net/apps/mediawiki/f ... title=Pivy
http://sourceforge.net/apps/mediawiki/f ... title=Pivy
Re: Model origin
The SoAxisCrossKit is a node kit and there you can usually access each component of it and may customize it. In this case you should be able to access the arrow withSo, my final question is - is it possible to make arrows a bit wider?
Code: Select all
axis=axisCross.getPart("shape",0)
cone=axis.getPart("xHead.shape",0)
cone.bottomRadius.setValue(10)
Re: Model origin
Hi,
Thank you guys for help, but radius of an arrow is not what I wanted. I wanted a bit bigger radius of a line that connects arrow and the origin.
This is what I have now:
------------------->
I would like to have this:
=============>
You probably figured out which radius now.
Since I'm new to python (and generally to object oriented programming) I still have one final question:
When I'm writing down final line in python console:
cone.bottomRadius.setValue(10)
when I write 'cone.' a list appears. Why is 'bottomRadius' not listed in this list? and where in documentation can I find 'bottomRadius'
Regards,
Petar Perisin
Thank you guys for help, but radius of an arrow is not what I wanted. I wanted a bit bigger radius of a line that connects arrow and the origin.
This is what I have now:
------------------->
I would like to have this:
=============>
You probably figured out which radius now.
Since I'm new to python (and generally to object oriented programming) I still have one final question:
When I'm writing down final line in python console:
cone.bottomRadius.setValue(10)
when I write 'cone.' a list appears. Why is 'bottomRadius' not listed in this list? and where in documentation can I find 'bottomRadius'
Regards,
Petar Perisin