Automated spaces from sketch and further automation

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
dimitar
Posts: 229
Joined: Thu Jun 13, 2019 6:10 am
Contact:

Automated spaces from sketch and further automation

Post by dimitar »

I've been scratching my head about the possibilities of better spaces since discovering the tools a few days ago and having to manually make a bunch of rooms outlines that are oddly shaped. It is something that I felt that Freecad could already handle, and my gut feeling seems true, for the most part. So here is the process:
  • make a sketch that will be used for the walls
  • Part WB extrude the sketch to make thin edges
  • make another sketch constrained to the boundaries of the walls. Move the sketch up slightly so the bounding edges are not coincident
  • in the Surface WB, create a surface from the bounds sketch
  • back in Part WB, use the boolean fragments tool
  • create a draft line that crosses only the walls
  • use the CompoundFilter tool on top of the boolean fragments. Set filter type to collision-pass, for stencil use the drawn line, and set the invert to True. Set window from 0 to 100. now there should be nicely fragmented footrpint faces
    extrude either with slab tool or with part extrude
The above are the bits that work really nicely

The next steps need to be redone at the moment if the wall sketch gets updated and the number fragments changes (ie more or less rooms) for the spaces to work as they currently do.
  • explode the Compund tool on the Extrusion, which results in a group with the fragments
  • Select each element individually and use the space tool
Ideally, the last two steps should be automated as well, either by an update on the space tool, in that it can automatically generate separate spaces if more than one perfect boundary is found or this should be a done by a script that automatically converts each of the volume to a space and places the text.

Not sure which approach would look after the changes in the number of spaces in a way that preserves the indices.
FreeCAD_fN0BNkAKQI.png
FreeCAD_fN0BNkAKQI.png (236.75 KiB) Viewed 1409 times

Further thinking about it, the whole process could be automated besides the initial walls sketch:
  • create initial walls sketch by hand
  • get the bounds of the wall sketch, maybe turn it into a face(s) or another way to create an automatic boundary?
  • then use the same steps as above in a script
Attachments
automated spaces.FCStd
(92.65 KiB) Downloaded 28 times
Last edited by dimitar on Sat Jan 22, 2022 11:47 am, edited 1 time in total.
User avatar
dimitar
Posts: 229
Joined: Thu Jun 13, 2019 6:10 am
Contact:

Re: Autoated spaces from sketch and further automation

Post by dimitar »

As for further automation, somehow I wonder if it's possible expose the dimensions of a sketch so they can be printed out. The way I see it, there are already dimensions so it becomes a bit redundant to dimension things again.

I know that currently, I can use the edges of a sketch to add dimensions, bounds, but again, it feels like a step that maybe could be automated?
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Autoated spaces from sketch and further automation

Post by paullee »

In fact, this should be implemented long time ago to streamline design development :)

With basic python knowledge, I experimented that and there were discussions on several usages e.g. 'Drawing Rooms', Area Calculation, CellComplex creation. Hope peoples with more time and experienced in programming would be interested to help iron out all the details and implementation :D

By the way, you can have a look at below which simply your workflow (basically part of what I implemented)
https://wiki.freecadweb.org/Part_Slice# ... g_a_Puzzle
User avatar
dimitar
Posts: 229
Joined: Thu Jun 13, 2019 6:10 am
Contact:

Re: Autoated spaces from sketch and further automation

Post by dimitar »

paullee wrote: Sat Jan 22, 2022 10:31 am With basic python knowledge, I experimented that and there were discussions on several usages e.g. 'Drawing Rooms', Area Calculation, CellComplex creation. Hope peoples with more time and experienced in programming would be interested to help iron out all the details and implementation
Yes I got the idea from your github sketcharch (for which the exposed host property for doors is lifesaver by the way!, thank you, and wondering whether there is a way to expose more properties per instance, like if doors have a number, each linked instance should have its own number). I saw the description of the area calcs but i guess the tool hasn't made it to the published version yet, but yes it would be great to for it to be there.
paullee wrote: Sat Jan 22, 2022 10:31 am By the way, you can have a look at below which simply your workflow (basically part of what I implemented)
https://wiki.freecadweb.org/Part_Slice# ... g_a_Puzzle
Super cool! yes, this seems a bit nicer.

Do you have any thoughts on dimensions from sketcher to draft?
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Autoated spaces from sketch and further automation

Post by paullee »

dimitar wrote: Sat Jan 22, 2022 10:38 am Yes I got the idea from your github sketcharch (for which the exposed host property for doors is lifesaver by the way!, thank you, and wondering whether there is a way to expose more properties per instance, like if doors have a number, each linked instance should have its own number).
Not sure I understand you about the 'exposed host property' and 'if doors have a number, each linked instance should have its own number' ? :)

Incidentally, the 'intuitive parametric placement' feature works on Links also - you create App::Links of a Window/Door object, each of these Links have added parameters individually to allow attaching to particular segment of wall .

dimitar wrote: Sat Jan 22, 2022 10:38 am I saw the description of the area calcs but i guess the tool hasn't made it to the published version yet, but yes it would be great to for it to be there.
Probably, it was done sometime ago - it works for myself but the workflow is still complicated for common users.

dimitar wrote: Sat Jan 22, 2022 10:38 am Do you have any thoughts on dimensions from sketcher to draft?
It was discussed at several occasions, but it seems there is no consensus to implement it. But what are interested to architectural partitioner are the dimension between wall edges (the Sketch edges are kind of 'wall axes') - this is far more complicated to implement (for me) :)
User avatar
dimitar
Posts: 229
Joined: Thu Jun 13, 2019 6:10 am
Contact:

Re: Autoated spaces from sketch and further automation

Post by dimitar »

paullee wrote: Sat Jan 22, 2022 10:31 am With basic python knowledge, I experimented that and there were discussions on several usages e.g. 'Drawing Rooms', Area Calculation, CellComplex creation. Hope peoples with more time and experienced in programming would be interested to help iron out all the details and implementation :D

https://wiki.freecadweb.org/Part_Slice# ... g_a_Puzzle
From your experience what's the best use method from all the experiments you've posted for automated spaces? And in some of the links, it looks like you may have some scripts?
dimitar wrote: Sat Jan 22, 2022 10:38 am It was discussed at several occasions, but it seems there is no consensus to implement it. But what are interested to architectural partitioner are the dimension between wall edges (the Sketch edges are kind of 'wall axes') - this is far more complicated to implement (for me)
In many cases initial automatic dimensions from "wall axes" derived from a sketch would be quite a welcome efficiency. I am thinking that there could be a script that check for the sketcher dimensions, which vertices they are using, and rebuild them linked with draft dimensions, so if a user wishes to delete some s/he can do so without breaking the sketcher constraints. Really need to start digging into the API a bit more to learn how to do these.
paullee
Veteran
Posts: 5098
Joined: Wed May 04, 2016 3:58 pm

Re: Autoated spaces from sketch and further automation

Post by paullee »

dimitar wrote: Sat Jan 22, 2022 11:52 am From your experience what's the best use method from all the experiments you've posted for automated spaces? And in some of the links, it looks like you may have some scripts?
2 kind of objects I had been creating. One is 'CellComplex' - a term from Topologic - which is like what you are doing, those volumes share common face (wall-axis). The another is really the volumes of Space bound by wall surface.

The first kind 'CellComplex' is easier, implemented with something like the PartSlice, similar thought as you do. Hope to feed into Topologic to do some spatial analysis in future.

The other one have usescases like calculating floor area, volume for space cooling/heating etc. This one is much more tricky for me - I ask for some idea early but can't find a good approach I can implement. In AutoCAD, user only need to click at a point on the 2d layout, and it deduce the boundary, i.e. the room.

The implementation is not kind of script but built-in the SketchArch add-on - so the CellComples / Rooms would update when the ArchSketch layout update.

dimitar wrote: Sat Jan 22, 2022 10:38 am In many cases initial automatic dimensions from "wall axes" derived from a sketch would be quite a welcome efficiency. I am thinking that there could be a script that check for the sketcher dimensions, which vertices they are using, and rebuild them linked with draft dimensions, so if a user wishes to delete some s/he can do so without breaking the sketcher constraints. Really need to start digging into the API a bit more to learn how to do these.
Yes, to me this seems doable - in fact, currently Draft Dimension to my memory can 'link' to an edge of object (just it suffers from the Topnaming problem - SketchArch can ways to circumvent it though). You may try.


Hope more discussions attract more developers, or more peoples learn to code / write some script or macros to help :)
Post Reply