[Discussion] Drafting 2d annotations for architecture

A forum dedicated to the Draft, Arch and BIM workbenches development.
onekk
Posts: 379
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: [Discussion] Drafting 2d annotations for architecture

Postby onekk » Mon May 25, 2020 5:00 pm

Sadly without some support, I can't develop entirely all alone, the main concern is how to be able to add the db file into the FCstd format.

This have to be done by some developers, as touching the File format is a delicate things, or at least have some assistance on working on this matter.

It suffice to have two exposed interface, save_to_file and load_from_file (as file in intended to be the FCsd document) this will lead to many expansion in future, as it is easy to incorporate other file formats, when using or developing a workbench, not too many other things are needed.

Once there is the ability to store a "custom "file in the compressed format and tto be able to retrieve it, no more work will be requested.

I'm thinking of coupling at least in the development phase the db file in the user directory, so it is persistent here, and experimenting with this one.

Best Regards

Carlo D.
carlopav
Posts: 1378
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: [Discussion] Drafting 2d annotations for architecture

Postby carlopav » Mon May 25, 2020 8:41 pm

onekk wrote:
Mon May 25, 2020 5:00 pm
I'm thinking of coupling at least in the development phase the db file in the user directory, so it is persistent here, and experimenting with this one.
This could be good to develop a proof of concept for the community to evaluate.

By the way, let's not lose the focus on the topic subject!
yorik wrote:
Wed May 20, 2020 9:00 am
Let's start designing such a generic, multi-annotation (Draft) annotation! I think it is a very good path to go.

I think it should:

1) not be shape-based, as there is no need for shapes here (no booleans, etc)
2) contain "subobjects" like texts, dimensions, and generic geometry (that can yes be obtained from shapes)
3) have a very nice and well-designed task UI and toolbar. Maybe actually it should be an own workbench? Like sketcher? That is activated on edit?
4) coded in C++? I would find that pretty interesting for the speed, and if we start a separate WB, we can start from scratch really nicely. I did something very similar when we started coding Path, started with designed the "invisible" subobjects (Path command, path tool, etc...) then the FreeCAD docobject that holds them all, then the view provider, then the UI... I think it proved pretty solid
I noticed that FreeCAD have already an App::Annotation and an App::AnnotationLabel object. Would those be of some help?
follow my experiments on BIM modelling for architecture design
User avatar
yorik
Site Admin
Posts: 11945
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: [Discussion] Drafting 2d annotations for architecture

Postby yorik » Fri May 29, 2020 1:33 pm

I think the best place to start with, for the structure would be in Path: https://github.com/FreeCAD/FreeCAD/tree ... d/Path/App
There you basically have the "Command" object which is a basic GCODE command. then the "Path" object that is nothing more than a list of commands. Then the "PropertyPath" which creates a Path property, then the "FeaturePath" which is the actual FreeCAD object, that has a "Path" property, which can hold a Path object, which is itself a list of Commands.

All this is derived from base FreeCAD classes, so it inherits a lot of interesting abilities, such as how it must be saved to the file, structure for easy python bindings, etc.

Then the GUI to make all this is something else, but it roughly follows the same structure as above.

I think we could start with something similar:

- A base Annotation class
- A Dimension class, a Text class and a Symbol class (and possibly others in the future), all derived from the above
- An "Annotations" property, that would hold a list of Annotation-derived objects
- An Annotation Feature that has an Annotations property
- A GUI object for the AnnotationFeature, that would have an edit mode just like a sketch. You manipulate the individual Annotations through it, the same way as the sketcher works.

This is a very "visual" object, it doesn't make much sense without a GUI. So I don't think there is much sense to separate the individual properties of dimensions, texts and symbols into App and Gui counterparts... Specially that they won't be directly manipulatable outside the Annotation Feature's edit mode.

Bascially each Annotation object should:

- have a name
- have a series of attributes such as start point, end point, color, text fonts... All that is needed for each of them
- be able to render a coin version of itself
- provide a list of control points
- be able to save and restore to file
- have all its attributes manipulatable through python

The AnnotationFeature should:

- have a placement
- be able to save and restore to file by calling save/restore of each of its annotations

The ViewProvider should:

- contain a transformation node with the placement data
- be able to render a coin version of itself by gathering the coin nodes of each of its annotations
- have an edit mode

The edit mode should:

- Show a list of annotations where one can click through, delete, rename or add new
- When one clicks an annotation, all its properties should be available to edit
- When one clicks an annotation, its control points should appear in the 3D view and be draggable by the user

How does that sound?
carlopav
Posts: 1378
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: [Discussion] Drafting 2d annotations for architecture

Postby carlopav » Fri May 29, 2020 4:47 pm

yorik wrote:
Fri May 29, 2020 1:33 pm
How does that sound?
Simply great! How can we start? Can you setup a branch containing an empty c++/python Annotations Wb?
follow my experiments on BIM modelling for architecture design
paullee
Posts: 2395
Joined: Wed May 04, 2016 3:58 pm

Re: [Discussion] Drafting 2d annotations for architecture

Postby paullee » Sat May 30, 2020 12:06 am

Really struggling to do some annotation :) But find can't follow the advanced technical discussion here :oops:
Screenshot from 2020-05-30 08-02-04.png
Screenshot from 2020-05-30 08-02-04.png (235.37 KiB) Viewed 300 times
carlopav
Posts: 1378
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: [Discussion] Drafting 2d annotations for architecture

Postby carlopav » Tue Jun 30, 2020 3:30 pm

Edit: reporting this interesting topic by @chakkree
https://forum.freecadweb.org/viewtopic.php?f=23&t=48040
chakkree wrote:
Tue Jun 30, 2020 4:45 am
ping
follow my experiments on BIM modelling for architecture design
paullee
Posts: 2395
Joined: Wed May 04, 2016 3:58 pm

Re: [Discussion] Drafting 2d annotations for architecture

Postby paullee » Tue Jun 30, 2020 6:13 pm

Currently, it is difficult to put it fittings like bathtub, toilets, basin, sink etc.

Used to have numbers of blocks available in AutoCAD, but there is only a few found in the Part Library.

It is currently both difficult to draw these objects in Draft as 2D or make them as 3D objects :)
(maybe better drawing as 2D in Sketch)
paullee
Posts: 2395
Joined: Wed May 04, 2016 3:58 pm

Re: [Discussion] Drafting 2d annotations for architecture

Postby paullee » Wed Jul 01, 2020 12:34 am

As simple as a bathtub e.g., say just want to put a 2d shape in the model for 2d drawing ( before a simple 3d one is available ) -

Can this bathtub be contained in an FC object instead of 3 ?

So it can more easily be moved around, cloned / app:link, numbers counted etc.

Any idea ? Thanks.
Screenshot from 2020-07-01 08-29-51.png
Screenshot from 2020-07-01 08-29-51.png (184.17 KiB) Viewed 110 times
Attachments
Bath-1_ 1.FCStd
(6.11 KiB) Downloaded 6 times
Last edited by paullee on Wed Jul 01, 2020 10:45 am, edited 1 time in total.
User avatar
Roy_043
Posts: 1399
Joined: Thu Dec 27, 2018 12:28 pm

Re: [Discussion] Drafting 2d annotations for architecture

Postby Roy_043 » Wed Jul 01, 2020 9:04 am

How about using a Std_Part and then linking to it with Std_LinkMake?

You could even put all bathroom furniture in an external file.
And have several versions of that file (2D, simple 3D, complex 3D).
paullee
Posts: 2395
Joined: Wed May 04, 2016 3:58 pm

Re: [Discussion] Drafting 2d annotations for architecture

Postby paullee » Wed Jul 01, 2020 11:34 am

Thanks @Roy_043 for the Std_LinkMake :)

Have tried DraftLinkArray etc. but not knowing Std_LinkMake yet. However, this needs a numbers of object.


I can make in Python console the shapes in the 3 objects into a dump Part object with compound of the shapes mentioned.

But there are few problems though:-
  1. Haven't found GUI command to do that - not very handy to do that in Python console
  2. It is a dump Part object, can't easily edited
Screenshot from 2020-07-01 19-26-47.png
Screenshot from 2020-07-01 19-26-47.png (144.47 KiB) Viewed 52 times
Attachments
Bath-1_ 1.FCStd
(15.89 KiB) Downloaded 5 times