BlenderBIM: vector based lines beyond the section cut

This discussion was created from comments split from: BlenderBIM: vector based lines beyond the section cut.

Comments

  • @JanF Correct, the BlenderBIM Add-on operates directly on the IFC, so it is possible to develop a standalone viewer ... with one issue which needs to be resolved: objects in the background (i.e. not cut) are rendered as raster. Currently, that uses the Blender OpenGL renderer, so a standalone one would have to recreate an OpenGL renderer... which is a bit of work, but not a huge amount, especially for someone who knows their C++ and OpenCASCADE.

    It is certainly possible to store 2D plans. Maybe what the course on BIM meant was that most vendors don't support it - the BlenderBIM Add-on is an exception to the rule, but is not the only one, but they are certainly rare. I can think of three ways:

    1. Fully linked to the 3D model, by storing element-by-element representations that are geometric context specific, as well as IfcAnnotation elements for all annotation, associated by IfcGroup and presentation layers (like CAD layers). This is how the BlenderBIM Add-on achieves it.
    2. Not linked to the 3D model, but stored in the IFC - this is the same as above, but instead you may group into a single IfcAnnotation if you wish, or also separate to any arbitrary number of IFC elements, but as there is no need to associate with the 3D model, you do not need to store the Model context on any of these elements. This is a bit similar to your "Blender empty object" example, but it wouldn't be an empty - it'd be something a little advanced that contains a lot of vector and style info that I'm not quite sure how to represent in Blender's UI yet, but certainly is possible in IFC.
    3. Associated as an externally referenced document file, with some metadata for positioning in 3D space. This achieves an effect similar to what tools like Revizto and construction overlay offerings provide when associating drawings with the model.
  • @Moult said:
    @JanF Correct, the BlenderBIM Add-on operates directly on the IFC, so it is possible to develop a standalone viewer ... with one issue which needs to be resolved: objects in the background (i.e. not cut) are rendered as raster.

    Is the Blender Freestyle renderer suitable for generating these background objects?

  • edited September 2020

    @brunopostle in my tests half a year ago, the HLR calculation was too costly (i.e. took too long) to be practical with Freestyle.

    Keep in mind that since it's simply a background layer created by Blender's render output, you could totally use freestyle if you wanted to. Nothing in the add-on forces you to only use a raster image as the background.

    For those who have seen the Sverchok vector drawings, they simply pile 2D polygons on top of one another with Z layering, so although it's much faster to compute, you end up with SVGs with very huge filesizes. I've tested this approach too with OpenCASCADE but the drawing sizes were too huge to be convenient.

    Tough nut to crack.

    brunopostledanielkrajnik
  • edited September 2020

    @Moult there are some 2D drawings where the 'background' is the drawing and the section cuts are secondary (elevations, reflected ceiling plans), in these cases we need to render the background as vector. I'm suprised that opencascade doesn't have some kind of efficient hidden line removal built-in. Obviously this is a hard problem, AutoCAD PDF output rasterises hidden line views too. [edit] the AutoCAD SOLPROF command does an almost perfect job with ACIS solids for orthogonal views, so it can be done.

  • @Moult I assume you are familiar with this paper?
    It seems to be pretty exhaustive on the different methods of generating the curves.

  • @brunopostle yes - agreed. In fact, a lot of drawings are pure elevation, especially in fabrication stage. I'm still searching for a better solution. I'm unfortunately not an expert in this - I don't have a training in algorithms for computer graphics, or really much computer science at all, and a lot of this is usually in C++, which I don't know how to code in. I hope someone can help solve it, but until then, I do what I can with the best of my ability :)

    As for OpenCASCADE, it does have a whole section on HLR: https://www.opencascade.com/doc/occt-7.4.0/refman/html/package_hlrbrep.html

    I definitely investigated it many moons ago when I was starting to tackle this problem, but from memory (memory fades!) I think it only addressed lines, whereas I needed to know face areas - since in a lot of these elevation drawings, you often want to shade the surface, not just the lines. But there's a huge list on that page I linked to, and I think I only investigated a few, so I perhaps missed something. In fact, I hope I missed something and perhaps it's actually very easy :)

    Also, I think the solution is much easier with solids, since there are rules around each type of solid - in IFC, where you get meshes, solids, and even parametric I-Beams as a primitive shape, things become a little be hairier.

    @JanF - I'm not familiar with that paper unfortunately. I had a skim through and it looks excellent, and hopefully there is a solution buried there somewhere. I'm a little tied up at the moment, but hopefully I can revisit this thread in the future. However, if someone wants to jump in, the shopping list is as follows:

    1. Fast
    2. Needs to extract edge vectors, not pixels (there are lots of pixel based algorithms, which is similar to what I'm doing now with Blender's OpenGL wireframe render)
    3. Needs to extract faces - and even more particularly, know when to join faces into a shaded whole, or maybe this is too hard (from memory, I think Revit's shaded faces
    4. Needs to correlate extracted edge / face back to the original object (so that semantic styles can be applied)
    5. Ideally, something that isn't too much of a pain to work with OpenCASCADE shapes
    brunopostletheoryshawjamesjkyLuisdanielkrajnik
  • edited September 2020

    Heads up, blender will embed potrace for grease pencil soon (2.91) maybe this will help in getting vectors from pixels - don't know if a trace api will be exposed for addons.
    Perhaps the 3d to 2d tool of grease pencil may be an option ?

    theoryshaw
  • Noobie question. Why not use Blender's Freestyle SVG plugin to create vector lines on objects that are beyond the section cut?

  • @theoryshaw when I tried it, it was too slow. Maybe I wasn't using it correctly, I'm not experienced enough in Freestyle to know what I don't know :)

  • edited November 2020

    Freestyle is painfully slow as vector generation rely on rendered pixels data and there are some "threshold" issues in the vectorization process.
    The new approach (LANPR) use opengl display information instead, leading in near real-time vector generation - but the "threshold" issues will remains.

    theoryshaw
  • @stephen_l said:
    Heads up, blender will embed potrace for grease pencil soon (2.91) maybe this will help in getting vectors from pixels - don't know if a trace api will be exposed for addons.
    Perhaps the 3d to 2d tool of grease pencil may be an option ?

    I assume this is what you were talking about?

  • This is about potrace

    theoryshaw
Sign In or Register to comment.