About coding Techdraw non-vertex Dimensions

Discussions about the development of the TechDraw workbench
terok
Posts: 47
Joined: Tue Dec 19, 2017 8:07 pm

About coding Techdraw non-vertex Dimensions

Postby terok » Wed Jan 10, 2018 12:05 pm

Hi!

I am interested to implement new Dimension type as described in issue #3004 This is TechDraw - "non-Vertex" Dimensions.

I cannot guarantee a success, but it would be nice to try. What do you think, if I get that Feature Request assigned to me and start coding?

Edit: First I need examples of use cases, until I could code anything.

--Tero
User avatar
Kunda1
Posts: 5818
Joined: Thu Jan 05, 2017 9:03 pm

Re: About coding Techdraw non-vertex Dimensions

Postby Kunda1 » Wed Jan 10, 2018 12:31 pm

terok wrote:
Wed Jan 10, 2018 12:05 pm
Hi!

I am interested to implement new Dimension type as described in issue #3004 This is TechDraw - "non-Vertex" Dimensions.

I cannot guarantee a success, but it would be nice to try. What do you think, if I get that Feature Request assigned to me and start coding?

--Tero
Suggestion:
You can state on the ticket that you want to take a stab at it (add the forum thread for further discussion). If and when things go well we can add you to the tracker as a dev.
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
terok
Posts: 47
Joined: Tue Dec 19, 2017 8:07 pm

Re: About coding Techdraw non-vertex Dimensions

Postby terok » Wed Jan 10, 2018 1:07 pm

Kunda1 wrote:
Wed Jan 10, 2018 12:31 pm
Suggestion:
You can state on the ticket that you want to take a stab at it (add the forum thread for further discussion). If and when things go well we can add you to the tracker as a dev.
Hi Kunda1, thanks again! I will add my willingness to implementation to the ticket, and put there also a link to this thread.

I am little afraid that maybe this will be too advanced to implement by me. We will see.

Edit: Now done adding my note to ticket.
User avatar
Kunda1
Posts: 5818
Joined: Thu Jan 05, 2017 9:03 pm

Re: About coding Techdraw non-vertex Dimensions

Postby Kunda1 » Wed Jan 10, 2018 3:10 pm

:thumbsup:
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
terok
Posts: 47
Joined: Tue Dec 19, 2017 8:07 pm

Re: About coding Techdraw non-vertex Dimensions

Postby terok » Wed Jan 10, 2018 4:13 pm

Thanks :D
wandererfan
Posts: 3091
Joined: Tue Nov 06, 2012 5:42 pm

Re: About coding Techdraw non-vertex Dimensions

Postby wandererfan » Thu Jan 11, 2018 12:38 am

terok wrote:
Wed Jan 10, 2018 12:05 pm
I am interested to implement new Dimension type as described in issue #3004 This is TechDraw - "non-Vertex" Dimensions.
"Go big or go home!" :shock:
Here are my notes from my TODO list on this, they are cryptic, but might be helpful. I think there is an actual discussion/suggestion in the forum somewhere. I'll see if I can find it.

Code: Select all

- "non-vertex measurements" ??
  - overall height/width? extents?
    - vert/horiz/both
    - bbox? already calculated??
      - GO::calcBoundingBox()  (Base::BoundBox3d)
      - dvp::bbox   (Base::BoundBox3d)
  - no references? how to save/restore? 
      - ref1 = (bbox.minX,0), ref2 = bbox.maxX,0)??
  - need that stackable button <<<<  see Drawing or Sketcher
If you want an easier 2nd fix, I can PM you a suggestion.

wf
terok
Posts: 47
Joined: Tue Dec 19, 2017 8:07 pm

Re: About coding Techdraw non-vertex Dimensions

Postby terok » Thu Jan 11, 2018 5:25 am

Thanks for link to ickby's example and for your notes.
wandererfan wrote:
Thu Jan 11, 2018 12:38 am
"Go big or go home!"
Poor me, what I have done yesterday by posting this thread.

Edit: This post is a WIP. I will update this when trying to get coding details solved.

The Feature Request talks about extrema system, but it is my first approach to get max values with bounding box approach.
Then later more on minum dists between 2 selected curves. OCC has lots of stuff under Extrema topic, min dist:
https://dev.opencascade.org/doc/refman/ ... shape.html

If non-vertex dimensioning should work everywhere with user clicking arbitrary point on arbitrary curves this is another case:
This seems to be already implemented on FC (in Draft module): Placing a dimension with snap mode "Nearest" will do just this?
So that code could be used as example?
Arbitrary dimensions are not topic of this FR.
_________
About 2dboundingbox dim:

As pointed in WandererFan's notes , one could perhaps just use TechDraw BoundingBox() funcs in GO/dvp classes.
Then this value should be shown as bboxes dimensions on view (x,y dir). Is the drawing done with Qpainter as I recall reading somewhere....

Now is good time to read CommandCreateDims.cpp and try to find out what is done in existing Dim commands.
Especially how does the save and restore work in other dim commands.
__

--Tero
Last edited by terok on Wed Jan 24, 2018 4:41 pm, edited 35 times in total.
terok
Posts: 47
Joined: Tue Dec 19, 2017 8:07 pm

Re: About coding Techdraw non-vertex Dimensions

Postby terok » Thu Jan 11, 2018 6:33 am

wandererfan wrote:
Thu Jan 11, 2018 12:38 am
If you want an easier 2nd fix, I can PM you a suggestion.
Edit again. Now 2nd TD fixup is done. Soon it is time to start coding first proto of this dimension stuff (and still continue doing other TechDraw fixes)

I think this is too much for me, someone else may code this. I am sorry about wasting everyones time.

--Tero
wandererfan
Posts: 3091
Joined: Tue Nov 06, 2012 5:42 pm

Re: About coding Techdraw non-vertex Dimensions

Postby wandererfan » Thu Mar 01, 2018 1:24 pm

terok wrote:
Thu Jan 11, 2018 6:33 am
I think this is too much for me, someone else may code this. I am sorry about wasting everyones time.
No worries. It was a big piece to bite off.
There are lots of small fixes available. Do you want to try one of those?
cron