Change Part workbench measure arrows?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
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!
analog999
Posts: 7
Joined: Mon Jan 30, 2017 6:46 pm

Re: Change Part workbench measure arrows?

Post by analog999 »

Thanks for the link. When I get the chance, I'll definitely make the change and submit the revision. I appreciate all the help from everyone.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Change Part workbench measure arrows?

Post by Kunda1 »

analog999 wrote:
Thanks for the link. When I get the chance, I'll definitely make the change and submit the revision. I appreciate all the help from everyone.
When you do, please notate issue #2034 with your progress... thanks!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Change Part workbench measure arrows?

Post by Kunda1 »

analog999 wrote:Thanks for the pointers. I don't have the build platform set up, hell I don't even know what you guys recommend, gcc or something I'm assuming.
https://www.freecadweb.org/wiki/Compiling is a good place to start. It seems like you have an idea of how to fix this. Please take a stab at it and see if you can fix it :)

Forking the FreeCAD repo on github is super simple.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
analog999
Posts: 7
Joined: Mon Jan 30, 2017 6:46 pm

Re: Change Part workbench measure arrows?

Post by analog999 »

Just to follow up on this, I can't compile the source right now as I'm using an older version of VS for my job that breaks when you try to install a newer version. I will make this change when I can get it up and running.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Change Part workbench measure arrows?

Post by Kunda1 »

analog999 wrote:Just to follow up on this, I can't compile the source right now as I'm using an older version of VS for my job that breaks when you try to install a newer version. I will make this change when I can get it up and running.
Thanks for offering. Cheers.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Change Part workbench measure arrows?

Post by wmayer »

Proof of concept that it works using the SoAutoZoomTranslation node:

Code: Select all


from pivy import coin
import math

type=coin.SoType.fromName("SoAutoZoomTranslation")
cone=coin.SoCone()
zoom=type.createInstance()
move=coin.SoTransform()
move.translation.setValue(10,0,0)

move2=coin.SoTransform()
move2.rotation.setValue(coin.SbVec3f(0.0, 0.0, 1.0), math.pi/2)
move2.translation.setValue(1,0,0)

move3=coin.SoTransform()
move3.rotation.setValue(coin.SbVec3f(0.0, 0.0, 1.0), -math.pi/2)
move3.translation.setValue(-1,0,0)

sep=coin.SoSeparator()
sep.addChild(zoom)
sep.addChild(move2)
sep.addChild(cone)

sep2=coin.SoSeparator()
sep2.addChild(zoom)
sep2.addChild(move3)
sep2.addChild(cone)

grp=coin.SoSeparator()
grp.addChild(sep)
grp.addChild(move)
grp.addChild(sep2)

root=Gui.ActiveDocument.ActiveView.getSceneGraph()
root.addChild(grp)
or

Code: Select all


from pivy import coin
import math

type=coin.SoType.fromName("SoShapeScale")
zoom1=type.createInstance()
zoom1.scaleFactor.setValue(10)
zoom2=type.createInstance()
zoom2.scaleFactor.setValue(10)

cone=coin.SoCone()
move=coin.SoTransform()
move.translation.setValue(10,0,0)

leftArrow = coin.SoShapeKit()
leftArrow.shape=cone
leftArrow.transform.rotation.setValue(coin.SbVec3f(0.0, 0.0, 1.0), math.pi/2)
leftArrow.transform.translation.setValue(1,0,0)

rightArrow = coin.SoShapeKit()
rightArrow.shape=cone
rightArrow.transform.rotation.setValue(coin.SbVec3f(0.0, 0.0, 1.0), -math.pi/2)
rightArrow.transform.translation.setValue(-1,0,0)

zoom1.shape=leftArrow
zoom2.shape=rightArrow

grp=coin.SoSeparator()
grp.addChild(zoom1)
grp.addChild(move)
grp.addChild(zoom2)

root=Gui.ActiveDocument.ActiveView.getSceneGraph()
root.addChild(grp)
Now create a standard box in Part to verify that on zoom the position and size of the cone doesn't change.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Change Part workbench measure arrows?

Post by Kunda1 »

wmayer wrote: Tue Oct 17, 2017 12:14 pm Proof of concept that it works using the SoAutoZoomTranslation node:
Any time to take care of this issue #2034? Looks like solutions exist (reading your response and previous responses in the thread). No rush, just wondering.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Change Part workbench measure arrows?

Post by wmayer »

The difficulty is to implement a nodekit class (https://coin3d.bitbucket.io/Coin/group__nodekits.html) based on the higher-level classes provided by OpenInventor where the scaling can be incorporated. I haven't found an elegant way doing so. The other option would be to implement an own nodekit from scratch with a lot of code duplication.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Change Part workbench measure arrows?

Post by Kunda1 »

@craig9 has created a possible fix for issue #2034
See https://github.com/craig9/FreeCAD/tree/bug2034
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply