Draft drawings containing many objects

A forum dedicated to the Draft, Arch and BIM workbenches development.
carlopav
Posts: 245
Joined: Mon Dec 31, 2018 1:49 pm

Draft drawings containing many objects

Postby carlopav » Sat Apr 06, 2019 7:20 am

Following the general discussion in this post:
https://forum.freecadweb.org/viewtopic.php?t=10337 "FreeCAD slow performance on create many (document) objects"

what i understood is:

FreeCAD is not thought to be used extensively (as Librecad or Autocad are) for 2d architectural drafting where you need to draw looots of single very simple elements (points, lines, circles, ecc.).
Instead in FreeCAD, as i lear from yorik, each object is a powerful and complex entity, and therefore their max number is not infinite. But the point, if I got it correctly, is that Coin is very powerful (can deal with loots more entities than Librecad), and the limit is mainly a stuctural limitation of the document tree (i think i'm simplyfiing a lot).

So if we create a single shape (single document object (?)) containing all the other simple 2d entities (edges, faces, ecc.) we can skip that limitation quite easily. This at the moment is done with part compound after the creation of draft objects (did i get i correctly?).

But what I was thinking is: can we have kind of Draft entity that works like a group but dont display subentities in the tree? Kind of a "DraftDrawing" that the user create at the beginning ad could be used to contain an imported dxf or to start a 2d non parametric drawing from scratch?

Something that can allow the user to create big 2d drawings in a non parmetric way inside Freecad. I understand that is not the main purpouse of Freecad, but the Draft module is here, and... why not exploit it till the end?

This got into my mind looking at @Moult work to allow modifiers tools to work on subelements. Why not have Draft creation tools also creating subelement?

I imagine that this could be huge to implement and I dont have any idea if these thought are just bullshit, but before 1.0 we have still some time ;) . I'd really like to know if anyone have developed thought on this too :).
chrisb
Posts: 18165
Joined: Tue Mar 17, 2015 9:14 am

Re: Draft drawings containing many objects

Postby chrisb » Sat Apr 06, 2019 9:57 am

There is already something like what you seem to imagine: the simple copy. Alas, as soon as you discard all the complexity below the nice shiny surface (pun intended) you loose all parametric advantage. I.e. if you change a basic constituent nothing will happen to the final solid.
carlopav
Posts: 245
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft drawings containing many objects

Postby carlopav » Sat Apr 06, 2019 10:43 am

Thx Chris, good to know! I was looking for something more flexible, that maybe can keep trace of objects like wires, can accept different color and linestile for subelements and that if one have to add a line segment to that object he dont have to group and copy again the whole object. More like a drawing inside the drawing... Maybe a block? in italian i would say "boh" (Dunno).
vocx
Posts: 1440
Joined: Thu Oct 18, 2018 9:18 pm

Re: Draft drawings containing many objects

Postby vocx » Sat Apr 06, 2019 4:15 pm

carlopav wrote:
Sat Apr 06, 2019 7:20 am
Following the general discussion in this post:
https://forum.freecadweb.org/viewtopic.php?t=10337 "FreeCAD slow performance on create many (document) objects"

what i understood is:

FreeCAD is not thought to be used extensively (as Librecad or Autocad are) for 2d architectural drafting where you need to draw looots of single very simple elements (points, lines, circles, ecc.).
Instead in FreeCAD, as i lear from yorik, each object is a powerful and complex entity, and therefore their max number is not infinite. But the point, if I got it correctly, is that Coin is very powerful (can deal with loots more entities than Librecad), and the limit is mainly a stuctural limitation of the document tree (i think i'm simplyfiing a lot).

So if we create a single shape (single document object (?)) containing all the other simple 2d entities (edges, faces, ecc.) we can skip that limitation quite easily. This at the moment is done with part compound after the creation of draft objects (did i get i correctly?).
Thank you for linking to that thread, it's interesting information.

It seems, like, yes, every single object you create is immediately inside the Document, so it's an object of it.

Code: Select all

App.ActiveDocument.object
App.ActiveDocument.object001
App.ActiveDocument.object002
App.ActiveDocument.object100000
...
But what I was thinking is: can we have kind of Draft entity that works like a group but dont display subentities in the tree? Kind of a "DraftDrawing" that the user create at the beginning ad could be used to contain an imported dxf or to start a 2d non parametric drawing from scratch?

Something that can allow the user to create big 2d drawings in a non parmetric way inside Freecad. I understand that is not the main purpouse of Freecad, but the Draft module is here, and... why not exploit it till the end?
I think the real discussion is, does it matter? Do you notice a slow down after adding many elements? I notice that a file takes long, around 3 minutes, to load a 15 MB model with 3D and 2D objects, and a few TechDraw pages. It's not a lot of time, but as soon as the file is loaded, it responds quite well. I notice a slow down if you put many items inside Std Groups, so maybe this can be improved in the internal handling of the code.
This got into my mind looking at @Moult work to allow modifiers tools to work on subelements. Why not have Draft creation tools also creating subelement?

I imagine that this could be huge to implement and I dont have any idea if these thought are just bullshit, but before 1.0 we have still some time ;) . I'd really like to know if anyone have developed thought on this too :).
I don't know what Moult is working on. Is it described in a thread? Maybe you can post a link to it. I remember him posting a lot at the beginning of the year but now he sort of disappeared. Maybe he's hacking and doesn't want to be bothered at the moment.

I do think there is ways for FreeCAD to improve its speed, but I'm also wondering if the limitations are due to my particular hardware (old CPU, no discrete GPU, not enough RAM), or if it's a fundamental flaw of FreeCAD.
User avatar
yorik
Site Admin
Posts: 11514
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Draft drawings containing many objects

Postby yorik » Sat Apr 06, 2019 7:29 pm

Your analysis is quite accurate @carlopav. However, indeed we should at some point do some good testing to assess how strong is really the impact of having, say, 1000 small individual line objects rather than one compound which holds 1000 lines. But definitely the latter is way faster.

Grouping several objects into one is easy: Select many, create a compound, create a simple copy, delete the compound and the many objects. The problem is, it became uneditable.

In any case, having one compound object that holds many entities is an interesting thing to explore. In fact, one could imagine a universal edit tool, that would work on just ANY FreeCAD shape.

The main issue is sorting and figuring out what is inside a shape. A compound can contain just about anything: Solids, shells, faces, edges and vertices. So one should first have a good sorting algo, that would find, for example, all faces that are part of a solid, or all edges that are part of a face. So when an edge is moved, we know we need to recreate the face too.

Might be a good time to rethink the whole Draft Edit tool into something more ambitious ;)
carlopav
Posts: 245
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft drawings containing many objects

Postby carlopav » Sun Apr 07, 2019 9:10 am

I don't know what Moult is working on. Is it described in a thread?
Here you have it @vocx: https://forum.freecadweb.org/viewtopic.php?f=23&t=34114. I think this is quite precious topic (in this PR https://github.com/FreeCAD/FreeCAD/pull/1975 Moult added the possibility for draft modifiers to work on subelements; i think this is still in testing). Performance slowdown i experienced is not in visualization (zooming and panning) but in object editing (move rotate scale).

Thx for the reply yorik!
yorik wrote:
Sat Apr 06, 2019 7:29 pm
However, indeed we should at some point do some good testing to assess how strong is really the impact of having, say, 1000 small individual line objects rather than one compound which holds 1000 lines. But definitely the latter is way faster.
Yes, for sure this should be tested.

I think we should expect to be able to work with a compound in several ways:
- to create subelements with standard Draft creation tools,
- to modify subelements with standard Draft modifiers (and maybe the Draft Edit is just one of them) (Moult already started to work on this point)
- to be able to smartly work on subelements (I mean to understand if an object (edge or face) is part of a more complex entity (ex polyline, dimension (?)))
- to be able to assign different view styles to subelements (maybe this is not necessary since when we import a dxf a compound is created for every layer)

I'm quite sure 1 and 2 can be achieved and bring a good improvement in workflow (thinking about double clicking on a compound from the tree and everything the user draw or modify is done inside that compound). Not sure about what mean to work on 3 and 4, if it's necessary or it's just forcing too much the way the whole FreeCAD Draft module was thought and or just a bad idea.

what do u think?
User avatar
yorik
Site Admin
Posts: 11514
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Draft drawings containing many objects

Postby yorik » Sun Apr 07, 2019 3:40 pm

We could try to make a Draft compound object that behaves like an App PArt or PartDesign Body or BuildingPart: if you double-click it, it becomes "active". If such a compound is active, all created Draft objects go in it automatically.
carlopav
Posts: 245
Joined: Mon Dec 31, 2018 1:49 pm

Re: Draft drawings containing many objects

Postby carlopav » Sun Apr 07, 2019 5:03 pm

yorik wrote:
Sun Apr 07, 2019 3:40 pm
We could try to make a Draft compound object that behaves like an App PArt or PartDesign Body or BuildingPart: if you double-click it, it becomes "active". If such a compound is active, all created Draft objects go in it automatically.
That would be great... I'll try to investigate a bit about it.