OSArch Community

[prj] Blender add-on to create technical drawing

  1. S
  2. S

    Hi @duncan,

    I added a dedicated prj page to the wiki and to the software and blender add-on categories: https://wiki.osarch.org/index.php?title=Prj

    Let me know if it's ok.

    About the explanation you wrote in What is a software page on our wiki? I think it's ok.

    Maybe, in the section Usage of that page, it should be written how to create a new page (it's not so straightforward, it took me a while to do it) and explained better how to use categories to insert new contents to a thematic list.

  3. D

    I've given you upload rights @strumet so now you can upload an icon and a screenshot. I went through the page and did some copy-editing to give it the same style as the other pages. Looks good! If you want to use the wiki to start some docs you're very welcome.

  4. S

    @duncan Thank so much for your revision! You're a great editor!

    Now the page is much better.

    As soon as I create an icon for prj and find out what kind of screenshot could be meaningful I'll complete the page

    It seems that the link to the Blender_Add-on category doesn't work (it's actually missing). Do you know how to fix it?

  5. C

    @strumet said:

    @Constantinesis

    The hatch for the cut surface is a simple fill. You can change it by css (even using patterns): https://css-tricks.com/almanac/properties/f/fill/

    Thanks! It works ! You were right, checked the css and its fine, Then actually i installed ODA for dxf and it works so it was AI issue with svg,

    Does the CSS styling work only with svg right?

    One more thing that Blender needs now is some kind of built-in svg or dxf viewer or mode to integrate better. Or maybe some kind of collaboration with MeasureItArch plugin creator which offers viewport visibility It also has dxf export but I find yours much straightforward and easy to use for quick setups.

    Actually if i think about it, Blender has already all the features to visualize section cuts and floorplans in viewport but it just needs some kind of template or Mode or automation script to handle these in correlation with the modelling and exporting.

  6. S

    Thanks! It works ! You were right, checked the css and its fine, Then actually i installed ODA for dxf and it works so it was AI issue with svg,

    I'm happy it works!

    Does the CSS styling work only with svg right?

    Yes, it works with svg only (other than html, obviously).

    One more thing that Blender needs now is some kind of built-in svg or dxf viewer or mode to integrate better. Or maybe some kind of collaboration with MeasureItArch plugin creator which offers viewport visibility It also has dxf export but I find yours much straightforward and easy to use for quick setups.

    Actually if i think about it, Blender has already all the features to visualize section cuts and floorplans in viewport but it just needs some kind of template or Mode or automation script to handle these in correlation with the modelling and exporting.

    Your suggestions are interesting: prj is just born and, at the moment, I don't know which direction it will take in the future. I generally tend to think that every software has to do its own duty: Blender is a wonderful Swiss army knife for handling three-dimensional entities but 2D graphics is such a vast field that I think its better doing it with a dedicated software (and Inkscape is perfect for it).

    Anyway I can't be sure that I won't change my mind in the future: before releasing prj I didn't think to add a DXF/DWG exporter to it (it wasn't its main purpose). But after talking with the some users I realized that it would be a useful feature not difficult to implement

  7. G

    The dxf export feature is a must-have for me, I've tested it on one of my projects, and although the processing time was very long and most of my input meshes were non manifold, the output result was very clean. I just wish the layers output would be more customizable. I like to have walls / windows / doors / etc on different layers.

    Currently I either use a setup with line art modifiers but the resulting geometry is not very clean, or a Geometry Nodes setup to actually cut the geometry but it's really hard to get occlusion right.

    So I'll be following along :)

    I've worked on a custom dxf exporter for Blender for a while now so don't hesitate if you want a helping hand on anything related to dxf in your addon. Cheers

  8. S

    Hi @Gorgious, thanks for your precious opinion.

    I wonder why processing time was very long: usually, even if there are a lot of entities in the scene, drawing time is not too long. Generally there are two reasons for long processing time:

    • some object in the scene is extremely complex (with a huge amount of vertices)

    • a large size of the camera along with a high scale value and/or a high level of detail (LOD) -> in this case you can probably change these values and reduce processing time without affecting the result

    Could you try to launch Blender by command line? This way you can analyze the log during the drawing: here you'll you find the timing for every operation and, at the end, a list reposrting drawing time for every object in the drawing.

    I just wish the layers output would be more customizable. I like to have walls / windows / doors / etc on different layers.

    Implementing customizable layers in the DXF drawing is absolutely doable although it's not so easy to find a good rule about it: as you know, in Blender objects can be assigned to multiple collections while in DXF every object can be associated to just one layer.

    I've worked on a custom dxf exporter for Blender for a while now so don't hesitate if you want a helping hand on anything related to dxf in your addon

    Thanks so much! I'll contact you if I need it

  9. G

    Actually the file crashes at the end so I don't get to see the output :) The dxf does export, but I think one of the last operations bugs out. It might be related to admin privileges since I'm writing the files to the desktop (Windows).

    I've got a bunch of printouts like Process GEO_N0_STR_Poutres.017 (instanced by None) during evaluation time but no timestamps.

    Here's the end of the stack trace

    
        pixels = flatten([list(range(px_from_x+(resolution[0]*y),
    
      File "C:\Users\\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\prj\utils.py", line 217, in flatten
    
        return [item for sublist in li for item in sublist]
    
      File "C:\Users\\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\prj\utils.py", line 217, in <listcomp>
    
        return [item for sublist in li for item in sublist]
    
    MemoryError
    
    Error   : EXCEPTION_ACCESS_VIOLATION
    
    Address : 0x00007FF66B6E3544
    
    Module  : blender.exe
    
    Thread  : 000085ec
    

    It seems it takes around 1 sec per object with the bigger ones taking up to 1 min and I have around 1000 of them total. The polycount however is rather low with 50 000 triangles total.

    Here's the base model

    And inside the cam view with clipping limits

    However the dxf file seems to be pretty high quality, I really like that related meshes get exported on blocks. The ceiling / floors are not manifold so I didn't expect the hatches to be consistent there.

    Here's for instance after putting some related blocks on specific layers

    Regarding layers, I agree that common layering system in Autocad & co is very different from how objects can be grouped in 3D softwares, especially considering BIM and its type oriented classification. Also, the collection system in Blender looks like a regular layer system but it is a lot more complex and powerful. Here's an example of how I implemented it :

    But it adds a lot of overhead in the addon code to handle all cases. :)

  10. S

    Hi @Gorgious,

    the dxf exportation is the last operation (before deleting every newly created temporary object) so you should see the list of drawing time for every object.

    The crash doesn't seem related to the drawing process itself but to a very large amount of data that the add-on tries to store in the svg file: indeed, every svg stores the pixels occupied by the object in the rendered view (this way prj can compare the new scene with the previous one).

    Could you tell me the prj Scale, the prj LOD and the Orthographic scale of your camera?

    That's for sure: 1 sec for every object is a lot! 1 minute is an eternity!

    If your objects are not too much complex (and they are not for what I see) there should be something that causes this weird behaviour.

    For example this is the per-object drawing time for the attached drawing

    If you want to make some test you can make a new empty scene (with copy settings to keep the output path and the resolution) in the file and link in it just the camera and a few objects: then try to launch the drawing and send me the log (this way it shouldn't be too long).

  11. S

    Regarding layers, I agree that common layering system in Autocad & co is very different from how objects can be grouped in 3D softwares, especially considering BIM and its type oriented classification. Also, the collection system in Blender looks like a regular layer system but it is a lot more complex and powerful. Here's an example of how I implemented it...

    Thanks for the suggestion about the dxf layering system: I think it's not difficult to implement but, maybe, it could result in a more complex setting for the user. Let me think about it

  12. B

    @duncan said:

    @bitacovir I would love your comments as well - or just edit the explanation - it's mostly us two who make new software pages.

    I think it is very good explanation.

  13. D

    Have there been discussions with @Moult on how all of this great functionality could be part of BlenderBIM rather than (yet another) separate Blender Plugin? It seems to me that the way forward for Blender as a tool for AEC is not more and more separate and uncoordinated plugins - it's consolidation of effort and deep integration between functionality. This argument is of course valid for many plugins, but you're here to talk to and your plugin is very new. So now must be the best time for me to try and convince you. :-)

  14. S

    Hi @duncan and thanks for your invitation to make prj part of BlenderBIM. You don't have to convince me: I always thought that BlenderBIM is the obvious landing place for prj.

    As I said before prj was born to respond to an immediate need I had in my everyday job. In order to do that, I took the shortest path taking advantage of those blender's functionalities that was already there (notably lineart and grease pencil svg exporter).

    That was easy enough to implement for my very poor developing skills. But generating drawing from IFC is a very tough (and perfectly right) goal and I'm not sure I have the abilities to be helpful in this task.

    Anyway I'm here and I'm absolutely available to help as far as I can: how can we proceed?

  15. D

    @strumet said:

    how can we proceed?

    That's the big question! I think what @Moult often says is have a look through the bug tracker and roadmap and see if there's something there that looks interesting to work on.

  16. N

    Hi, here is my thoughts for what they are worth... I like .prj and I like the vision of an SVG export that contains links back to the IFC. I think both are needed and will make a rich and flexible architectural workflow. I note that with Blender 3.2 Collections can now be Assets, nice to drag in elevations, sections and plans ortho cameras and use for .prj

  17. G

    Alright I've run a bit more tests on a slightly smaller project of mine. I think I understand why I didn't get the regular output last time, because I was launching the addon from VScode. When I run it directly from Blender today with the system console it outputs fine. Objects are relatively fast to export.

    I tested the different LODs to see what's up. I see there's a page about camera settings on the wiki so I'd be thrilled to understand what exactly is the difference between the different LOD settings.

    My model is a water tower, 75k Triangles, roughly 150 objects. I noticed it bugged out with my working file so I applied all modifiers so everything is plain geometry with no evaluation shenanigans.

    Export time :

    LOD 0 : 6 sec

    LOD 1 : 15 sec

    LOD 2 : 22 sec

    LOD 3 : 54 sec

    LOD 4 : I think I ran out of memory after a few minutes.

    I expected some problems since some of my meshes are not manifold but all in all the hatching is pretty consistent, apart from the lower left where it joined two areas that should not be solid. This alone is ought to save me a bunch of time, so I'm already happy with the result.

    I did not notice much difference between the different LODs, apart from some small objects not being rendered in LOD0. Here's a side by side comparison between LOD0 (blue) and LOD1 (red). LOD 2 and 3 did not add any details AFAICT.

    I think the last I would wish from the export file is the intersections between objects, like here

    And the ability to customize layers a bit more :)

    Also, regarding merging the feature with the blenderbim addon, I think it is a great idea, but please keep an option to export things with 2 or 3 clicks like it is now, it's really convenient ! On most projects I can't afford to spend an entire day setting up an ifc project to export my plans.

    Cheers !

  18. S

    @duncan said:

    That's the big question! I think what @Moult often says is have a look through the bug tracker and roadmap and see if there's something there that looks interesting to work on.

    Hi @duncan,

    I need some time to catch up with the drawing mechanisms of BlenderBIM (I'm going to read the long discussion on the issue #1153) in order to be "on board" on this topic.

    In the meantime do you have some quick tutorial about drawing generation in BlenderBIM to suggest?

    I also think that, maybe, we should think to some kind of strategy to gradually merge prj into BlenderBIM: this way we could keep prj's functionalities immediately working and usable by users and, meanwhile, we could work on the code while receiving useful feedbacks and suggestions from users as @Nigel and @Gorgious already did (thanks guys for you precious opinions!)

  19. N

    Hi @strumet I set up some standard views ortho camera, plans sections elections. It would be awesome to batch export to SVG rather than one at a time, what do you think?

  20. S

    Wow @Gorgious! Nice drawing! Your tests are very valuable for me. Thanks so much for that!

    I tested the different LODs to see what's up. I see there's a page about camera settings on the wiki so I'd be thrilled to understand what exactly is the difference between the different LOD settings.>

    ...

    I did not notice much difference between the different LODs, apart from some small objects not being rendered in LOD0. Here's a side by side comparison between LOD0 (blue) and LOD1 (red). LOD 2 and 3 did not add any details AFAICT.

    You're perfeclty right!

    Generally you can keep the LOD to 0 or 1 and raise it only if some very tiny objects in the scene are not drawn. Here's how it works: prj makes some flatten colors rendering (no antialiasing) in order to check objects visibility and keep track of their position *. The LOD define the amplitude of the resolution of these renderings:

    • LOD = 0 -> every square millimeter at the output scale can contain just 1 object

    • LOD = 1 -> every square millimeter at the output scale can contain up to 4 object

    • LOD = 2 -> every square millimeter at the output scale can contain up to 16 object

    • LOD = 3 -> every square millimeter at the output scale can contain up to 64 object

    • LOD = 4 -> every square millimeter at the output scale can contain up to 256 object (probably it's better to cut away this one and the previous one)

    * This way you can redraw just the objects that has been edited and update existent drawings quickly (at the moment it works for svg only)

    My model is a water tower, 75k Triangles, roughly 150 objects. I noticed it bugged out with my working file so I applied all modifiers so everything is plain geometry with no evaluation shenanigans.

    That's odd: prj should apply all object's visual transformations (like modifiers). Could you tell me which are the modifiers that generate the error?

    I think the last I would wish from the export file is the intersections between objects, like here

    About intersections I think I could work on it: lineart is already capable to calculate intersections between objects but only for collections or scenes while prj generate a lineart for every single object... I'll have to figure out how to solve this. In the meantime you could try creating real intersections objects (i.e. by boolean operations or Intersect(Knife)) and add them to the scene to draw (maybe I should make a little video to explain how to do it).

  21. S

    @Nigel said:

    Hi @strumet I set up some standard views ortho camera, plans sections elections. It would be awesome to batch export to SVG rather than one at a time, what do you think?

    Hi @Nigel,

    in the earlier stages of development prj worked like this, indeed.

    Then I removed this feature to allow partial redrawing: selecting just one camera and the objects you want to update... with multiple cameras it resulted in a more complex situation for the user.

    Anyway I think I could make some tweak to the code and allow to automate the drawing procedure by external scripts. This way you should be able to easily launch multiple drawings at once.

    I'll let you know when it's ready (I think it will be possible with version 0.0.9, while today I released prj v0.0.8, which add imperial units support).

  22. S

    I'd like to recall that to address bug reports, questions, feature requests you can use the issue page of the prj repository: this way every problem - and every solution - will be easier to find for other users

  23. D

    @strumet said:

    I need some time to catch up with the drawing mechanisms of BlenderBIM (I'm going to read the long discussion on the issue #1153) in order to be "on board" on this topic.

    In the meantime do you have some quick tutorial about drawing generation in BlenderBIM to suggest?

    Sorry, I'm a power-supporter and barely even a user. My life is too full of other things. @SigmaDimensions @condur @Moult what are the best learning resources just now? And are there links to them from https://wiki.osarch.org/index.php?title=BlenderBIM_Add-on#External_Resources

  24. C

    @Gorgious said:

    Also, regarding merging the feature with the blenderbim addon, I think it is a great idea, but please keep an option to export things with 2 or 3 clicks like it is now, it's really convenient !

    Exactly my view! BlenderBIm integration would be great and needed but should keep a standalone version too for quick conceptual exports!

  25. S

    @Nigel said:

    Hi @strumet I set up some standard views ortho camera, plans sections elections. It would be awesome to batch export to SVG rather than one at a time, what do you think?

    Hi @Nigel,

    I added multiple cameras support.

    The feature will be in the next release but if you'd like to try it already you can find a pre-release here attached.

    And thanks for your help!

  1. Page 1
  2. 2
  3. 3
  4. 4
  5. 5

Login or Register to reply.