Sunday 17 March 2013

First step of having DImensions in Drawing Module


Spent today working on adding dimension support. The first results are in and are quite pleasing. The dimension lines aren't correct but do indeed move interactively and the values for the dimensions update with changes basic changes in geometry. Obviously this is no where near being done, but is a step in the right direction once again.

-----
One area that does become problematic is making large changes in the geometry, and will be quite troublesome to deal with, even with robust naming. This should be a problem with vertices. because they cannot be decomposed further. 

Currently dimensions refer to the individual projected edge, or vertex because in theory multiple projected curves could exist. This needs further thought, but perhaps the best solution is consider merging projected edges together which share the original reference to the object and then having dimensions refer to these instead. Any ideas? 


3 comments:

  1. I have a really basic and stupid question for you:

    How are you running your code for testing and getting the pictures you have posted here?

    From Python, I always just wrote the classes and functions then tested using the interactive shell. Can't do that with C++ (can you? I don't see any python bindings), and I can't figure out where you are calling your QGraphicsItemView* constructors from.

    Thanks!

    ReplyDelete
  2. In c++ you have you write the code for creating what you want and then running this in FreeCAD although you could create python bindings which would take up too much time at this early stage. You can test it by opening the Drawing workbench, and clicking create page (twice) because it throws an error. Select the part and create view and then double click on the page icon in the tree container.

    Here's a short explanation of the program flow to give you an idea.
    CanvasView is the actual QGraphicsScene object and DrawingView processes a list of FeatureView that are linked by reference in /App/FeatureViewPage. DrawingView then chooses the appropriate QGraphicsItem class (QGraphicsItemViewPart or QGraphicsItemViewDimension) and then calls a function in CanvasView to create this and add it to the scene.

    If you give me some time I can come on IRC (i'm GMT time) and guide you some more, but I am currently having a break from the computer in general over the next week :)

    Let me know how things go!

    Cheers
    Luke

    ReplyDelete
  3. Oh I didn't see that you hijacked some of the existing icons, also compiling your latest patched showed a new one or two. Awesome! But I think I am running into OpenGL problems because I am currently using a VM.

    But thanks for the tips on the flow, things are starting to come together. Hopefully I can be productive soon!

    Also don't let me interrupt your break anymore, I will learn what I can and catch up with you when you get back. Enjoy your vacation!

    ReplyDelete