CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [CAD formats] Blender export script for named ASCII STLbs (https://www.cfd-online.com/Forums/openfoam-meshing/61601-blender-export-script-named-ascii-stlbs.html)

wikstrom June 18, 2012 03:04

Version for 2.63+, including import
 
1 Attachment(s)
Hi,

I updated to work with 2.63 (bmesh modifications). Also includes import functions. Not 100% sure of surface normal handling or if snappyHexMesh cares.

See above for installation, and feel free to put it on the wiki. I leave it here.

/N

wyldckat June 18, 2012 16:02

Hi Niklas,

Many thanks for sharing! I've added a link to your post, because I felt too lazy to download+upload :)

Best regards,
Bruno

Gary January 23, 2013 07:36

Export to ASCII STL in Blender
 
Quote:

Originally Posted by wikstrom (Post 350158)
Hi,

I have extended the "default" STL import/export addon to include the option to export multi-solid ascii STL, similar to the above script. Still crude and I hope to extend the import functionality similarly, but have not don so yet.

I have tested this with blender 2.5.8. To activate this addon unpack the tgz in ~/.blender/<version>/
Code:

~/.blender/2.58/scripts
niklasw > tree
.
└── addons
    └── export_named_stl
        ├── blender_utils.py
        ├── __init__.py
        └── stl_utils.py

Then activate the addon in the blender user preferences.

/Niklas


Any one can help me how to activate this add on please?
I have unpacked the tgz and all files are in the right location, but just could not find the corresponding option from Blender user preference.
I am using version 2.62 on Ubuntu system.

wikstrom January 23, 2013 08:24

1 Attachment(s)
Did you put the files under ~/.blender/2.63/scripts/addons/export_named_stl ?

Maby a version thing. Do not remember what I have changed, if anything, to make it work for 2.63. Have a look at the attaches version, in your case to be unpacked in

~/.blender/2.62/scripts/addons/

/n

Gary January 24, 2013 09:58

This does not work for 2.6.2 version.
Actually I made a mistake in my first post, the file tested OK with blender 2.5.8 by Niklas Wikstrom works for 2.6.2.
Many thanks again, Niklas Wikstrom.

estrauss August 11, 2015 14:20

I've been looking for a utility like this. I got it to work in Blender for export in version 2.75, but it seems to conflict with the import STL functionality. I tried disabling the standard STL import and still got the error. I can't post a screenshot of the errors, but here they are summarized. It was 4 errors and I was attempting to import an ASCII STL file.

Traceback (most recent call last):
File "C:\Program Files\Blender.....\export_named_stl\...

_init_.py, line 111, in execute
dataDict = stl_utils.read_stl_solid(path)

stl_utils.py, line 331, in read_stl_solid
for pt in gen(data):

stl_utils.py, line 170 in _ascii_solid_read
log("SOLID %s"%solid)

stl_utils.py, line 164, in log
with open('/tmp/blendertest.log','a') as fh:

FileNotFoundError: [Errno 2] No such file or directory: '/tmp/blendertest.log'

location: <unknown location>:-1

There could be some typo's in my summary, but I could not select the error text and I'm freshly new to Blender.

Has anyone had this or know of a simple fix?

AqeelAhmed168 April 22, 2023 16:46

Work around for named surfaces in one file (.obj format)
 
In Blender 3.5 one workaround to retain the named surfaces is to export the file as obj(legacy). Activate 'OBJ Groups' from 'Object as' in the 'include' settings for the export.

To get the correct naming of surfaces, the object and mesh name should be the same in the Blender 'Collection' tree.


All times are GMT -4. The time now is 06:57.