Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

error importing .becg file in engrid
  • chutonio October 2010
    Hi everybody,

    I have a problem while importing becg files made with blender into Engrid.
    I get this error:

    Smallest edge length is 1e+99
    deleting operation



    Before exporting from blender I checked the water tightness, removed doubles and performed ctrlA-->scale and rotation to ObDATA.
    The error sounds quite definitive...maybe I forgot something very important or the geometry is too complicated?
    Thank you
  • chutonio October 2010
    Amazingly, or at least for a newbie like me, the very same error occurs with a very basilar cylinder.
    I made a cylinder with add mesh tool in blender, default edges and dimensions, no smoothing or anything else; then I checked anyway the doubles, CTRL T to make triangular faces, checked watertightness and and outside normals.
    But when I try to open the exported bceg file in Engrid it gives me the same line shown in the previous post, that sounds like an error, and no geometry appears.

    I tried, to go even easier, to do the same thing with a default cube and it works (giving me a smallest edge length of 2 as output and showing me the geometry).

    What's happening there?? Simply meshing cubes is no use...
  • Oliver November 2010
    Hello,

    I have been out of the office for the last two weeks; hence my reply is a bit late -- sorry about that. Your Blender file looks very strange and I am indeed able to reproduce your problem. Having said that, we never encountered anything like that before. The geometry is visible in Blender but it does not export well (neither Engrid nor Gmsh format).

    Could you please post the simple cylinder case you mentioned?
    Which version of Blender are you using?

    Regards,
    Oliver
  • chutonio November 2010
    Thank you for your reply.

    I made the design using blender 2.49b
    The only "strange" thing I might have done is using blender under windows to draw the geometry and under linux (but same version of blender) to export it and use it in the CAElinux package.
    Anyway creating a simple cylinder under linux' blender ended up with the same error.
    You can find the mentioned cylinder in the attachments.
    Thank you for your support
  • OK I am having the same error message. At first I took it to be a scaling error, as enGrid supposedly uses meters, whereas my model is in inches. So I scaled to 0.0254 m/in in Blender, ran the export script again. The numbers change in the file by the appropriate factor, but the error message remains. I am using script 0.2 from the Russian guy here on the forum.

    My sphere is 253 inches in diameter. I double checked it in the CAD model. I have no idea where all these values of >1000 are coming from:


    3 19665 19409 19666
    3 19666 19410 19667
    3 19667 19411 19668
    3 19668 19412 19669
    3 19669 19413 19670
    3 19670 19414 19671
    3 19671 19415 19672
    3 19672 19416 19673
    3 19673 19417 19674
    3 645 903 902
    3 646 904 903
    3 647 905 904
    3 648 906 905
    3 649 907 906
    3 650 908 907
    104 22111 22106
    3 22106 22112 22105

    3 22146 22145 22148
    3 22148 22147 22149
    3 22150 22149 22152
    3
  • The associated .stl data is formatted like the sample below. There are no vertex values on the order of magnitude of those found in the .begc file above. Clearly this is not simply a scaling error, as some of the vertices in the .becg above are correct, whereas others are completely crazy.

    solid OBJECT
    facet normal -0.61129513829717164 -0.025659213598293699 0.79098663620301368
    outer loop
    vertex 26.346126556396484 -1.5841677188873291 -5.4750185012817383
    vertex 26.344621658325195 -1.5651168823242187 -5.4755635261535645
    vertex 26.34495735168457 -1.5719971656799316 -5.475527286529541
    endloop
    endfacet
    facet normal -0.29938286687451721 0.0036471758693290579 0.95412609079207822
    outer loop
    vertex 26.346126556396484 -1.5841677188873291 -5.4750185012817383
    vertex 26.345539093017578 -1.5644049644470215 -5.475278377532959
    vertex 26.344621658325195 -1.5651168823242187 -5.4755635261535645
    endloop
    endfacet
    facet normal -0.3554523890894154 0.0017249214198752645 0.93469279645064229
    outer loop
    vertex 26.345539093017578 -1.5644049644470215 -5.475278377532959
    vertex 26.346126556396484 -1.5841677188873291 -5.4750185012817383
    vertex 26.346290588378906 -1.5604429244995117 -5.4749999046325684
    endloop
    endfacet
    facet normal -0.22930461010685177 0.00082243748106116538 0.97335436475126291
    outer loop
    vertex 26.347400665283203 -1.5573760271072388 -5.4747409820556641
    vertex 26.346290588378906 -1.5604429244995117 -5.4749999046325684
    vertex 26.346126556396484 -1.5841677188873291 -5.4750185012817383
    endloop
    endfacet
    facet normal -0.48384633637775704 0.013945815121053466 0.87504184872178092
    outer loop
    vertex 26.348512649536133 -1.5592771768569946 -5.4740958213806152
    vertex 26.347400665283203 -1.5573760271072388 -5.4747409820556641
    vertex 26.346126556396484 -1.5841677188873291 -5.4750185012817383
    endloop
    endfacet
    facet normal -0.86373820140400492 -0.10085677017727523 0.49374510766668156
    outer loop
    vertex 26.348678588867188 -1.5954427719116211 -5.4718022346496582
    vertex 26.346494674682617 -1.5915979146957397 -5.4748373031616211
    vertex 26.347892761230469 -1.6018157005310059 -5.4744787216186523
    endloop
    endfacet
    facet normal -0.31588399711565673 -0.015463116059744365 0.94867180437069942
    outer loop
    vertex 26.350618362426758 -1.5687669515609741 -5.4730920791625977
    vertex 26.346494674682617 -1.5915979146957397 -5.4748373031616211
    vertex 26.349845886230469 -1.5869215726852417 -5.4736452102661133
    endloop
    endfacet
    facet normal -0.91537759391368811 -0.34887214490896179 -0.20092806440964739
    outer loop
    vertex 26.346866607666016 -1.6038508415222168 -5.4747419357299805
    vertex 26.347253799438477 -1.604744553565979 -5.4749541282653809
    vertex 26.347005844116211 -1.6042219400405884 -5.4747319221496582
    endloop
    endfacet
    facet normal -0.87335351793096327 -0.31772061280032615 0.36919811066607028
    outer loop
    vertex 26.346866607666016 -1.6038508415222168 -5.4747419357299805
    vertex 26.347005844116211 -1.6042219400405884 -5.4747319221496582
    vertex 26.347322463989258 -1.6041630506515503 -5.4739322662353516
    endloop
    endfacet
    facet normal -0.42839729485847716 0.89764141057305491 0.10351645174732055
    outer loop
    vertex 26.347005844116211 -1.6042219400405884 -5.4747319221496582
    vertex 26.345514297485352 -1.6055967807769775 -5.4689826965332031
    vertex 26.347322463989258 -1.6041630506515503 -5.4739322662353516
    endloop
    endfacet
  • Engrid imports this stl just fine; I was only using Blender to set the boundary conditions.
  • wyldckat May 2012
    Hi atypicalguy,

    Try using the official python scripts for Blender 2.5 and up: http://engrid.git.sourceforge.net/git/gitweb.cgi?p=engrid/engrid;a=tree;f=src/blender_scripts;hb=HEAD - it's the "io_*.py" ones.

    Additionally, I've got a feeling that you've selected one too many objects, such as camera and lights, which would account for the very large values.

    The other possibility is that you exported in the wrong mode... this is a bit outdated but here is the description for Blender 2.49: http://engits.eu/wiki/index.php/Tutorials/Version1.2/Unstructured_Grids_for_OpenFOAM_With_Blender_and_enGrid#Two_Ways_of_Manipulating_Models

    Best regards,
    Bruno
  • OK I will do it again and confirm "Edit" mode. I am fairly sure I was in Edit mode to begin with however.

    Good thought about the script version. I will get it from github and try again.

    Kind of driving me mad as I need more resolution on the leading and trailing edges, and need Blender to define a separate resolution there apparently. Otherwise defining BC in EnGrid is perfectly adequate.
  • Thank You.
  • OK, I have attempted to export this file to Engrid literally 50 plus times, starting fresh from .stl import each time. I checked the .stl file and all dimensions appear correct. In Blender am able to select relevant sections of the mesh easily, using selection tools in edit mode, separate them using the "P" command, and I am able to see the separate objects in the Outliner window of Blender. I can make them visible or invisible, etc.

    Each object has a little triangle below it in the Outliner window. I shift-click on these little triangles for each of the six objects so that all object icons are highlighted in orange in the Outliner window, and each separate object's mesh vertices appear bright orange in the 3-D window when it is active. Clicking the little triangle icons puts the 3-D window into edit mode automatically, which I visually confirm. When all objects are selected, I ensure that all objects are visible. At this point I invoke the export script from the menu.

    I obtain the same result as before; the initial object I separate exports reasonably well. Most of the rest of the objects do not. They display crazy coordinate data in the .begc file.

    I am using the latest versions of the scripts from github. I have deleted the camera and lightsources.

    My hunch is that I am doing something wrong as I select the objects prior to export. Oliver has had a look at the file and is able to work with it and generate a case. I am using Blender 2.59 and have tried various versions of EnGrid on both Windows and Linux with similar results. I have searched a lot on the Blender manual and various forums for some sort of idea about what to try next. I have exported the objects separately into separate files, with similar results - the first object (farfield) generates a nice file and imports to EnGrid. The next object gives me bad coordinates after export.

    I cannot figure out where I am messing up this process. I will keep going with it, but I have a feeling it is something simple I am doing wrong in Blender. I feel like it is something specific to the way the EnGrid export script works with Blender.

    Anyone have any other ideas?

    Thanks,
    Karl
  • wyldckat May 2012
    Hi Karl,

    Could you upload to somewhere a simple case where you can reproduce this error?

    Because there are few details that come to mind:
    1. You might want to try Blender 2.61 or 2.62, or go back to 2.49b. This way it'll be easier (at least for me) to reproduce the problems you're having.
    2. I've had a problem in the past with referentials in Blender and it was due to not using the same Edit mode for all objects. One small motion of a point or object and puff... but I think I already mentioned this.
    3. I've also had problems importing STL files to Blender. I vaguely remember that it was either due to a problem in reading the STL file or because the STL file wasn't imported into the Edit mode, which led to crazy placements in space...

    Another thing you might want to try is to merge all of the faces back into a single object and check if that merged geometry works well or not.

    Good luck! Best regards,
    Bruno
  • https://www.dropbox.com/s/c35pb0hgpz7hw9o/Mainfoil%20stl%20for%20CFD%202.stl

    I was using 2.59 because I was not certain the scripts would run properly in 2.62/3. But I think you are right - it is something I am doing wrong in edit mode and not the software version.

    I am able to import the .stl to Engrid fine. I will try exporting it as a single object from Blender to see if it works that way.

    It will be nice to get this figured out. Thanks again for your help.

    Karl
  • Oops - that one might be private. If it doesn't work, try this one:

    http://dl.dropbox.com/u/34549456/Mainfoil%20stl%20for%20CFD%202.stl
  • PS the latest scripts on github don't work with 2.6 Blender, at least on my Windows 7 machine.
  • wyldckat June 2012
    Hi Karl,

    Unfortunately, I haven't been able to look into this yet. But I do have a couple of questions:
    * The scripts you're talking about, are they the ones located here: http://engrid.git.sourceforge.net/git/gitweb.cgi?p=engrid/engrid;a=tree;f=src/blender_scripts;hb=HEAD - namely the ones that start with "io_"?

    * Blender 2.63 apparently has a few new features that can lead to some scripts having problems. Make sure you're using either Blender 2.62 or 2.61.

    Best regards,
    Bruno
  • Thanks Bruno.

    Yes I am using those scripts. I am on 2.59 still so I used the scripts from that folder. I am copying the text for each file, pasting and saving it as a .py file in Notepad to the /blender/2.59/scripts/addons folder in Windows 7.

    Interestingly, since my last post I have discovered that if I select one patch, and export it alone, the .begc imports to Engrid without problem. But when I select multiple patches, values get large, and I get the error "1e+099" message. I have deleted the camera etc. from the "scene". Hmmm. It is always possible that I used the wrong script file somehow, so I have just downloaded them again and replaced my .py files. It would be great if that were the problem.

    Initially I was using 2.63 and received a totally different error message, which is why I switched to 2.59.

    Anyway I am making some progress but did not have much time to work on it over the past two weeks. I hope to get back to it this week.

    Thanks Again,
    Karl





  • Oliver June 2012
    Hi Bruno & Karl,

    I have updated the scripts for Blender 2.63a -- there is also an option to automatically split quads now.

    The scripts are on my Dropbox account: http://db.tt/kiAeshTR

    Cheers,
    Oliver
  • Hi Oliver,

    That link is not working. Can you please re-post?

    Thank You,
    Karl
  • Oh never mind - I got them from sourceforge.

    Thx,
    K
  • wyldckat June 2012
    Hi Karl,

    With the new scripts and latest Blender, are things now working properly, or do you still have problems?

    Best regards,
    Bruno
  • Sorry for the delay; I am busy meshing things! I finally succeeded with the 2.63 scripts. Thanks Oliver for those. Actually, the ones from SourceForge worked also, but I am using the ones from Oliver's link now.

    I wish I could pinpoint the exact source of my problems, to save other users the time I spent experimenting with various versions of Linux/Windows/scripts and Blender. Basically all I can say is that I kept trying different things until it worked. In the end it may have been errors I was making while selecting objects in Blender; now I click all the little "plus" signs in the outliner window, then shift-click the little triangular symbol for each patch, turning each object icon orange. When all the icons are orange, I export it. I may also have had some scaling issues; my initial .stl files were in inches, whereas enGrid units are meters. It works a lot better in meters (!).

    With any luck, .begc export should work straightaway with 2.63 and the scripts provided above. When it works it is really amazing. Blender is quite a powerful tool for selecting patches and is free, apart from some hours to learn it. It now takes me about ten minutes to import my .stl, split it into patches, and export it to enGrid.

    Someday soon I hope to actually run a case... =:-)

    Thanks again Oliver and Bruno for your help.

    Karl

  • keepfit August 2012
    I tried that script and it works perfectly with Blender 2.63.