To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cadOpen lugnet.cad in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / 15401
15400  |  15402
Subject: 
Re: Blender to LDraw exporter (Blend2Dat v0.2)
Newsgroups: 
lugnet.cad
Date: 
Wed, 16 Jul 2008 07:43:21 GMT
Viewed: 
5408 times
  
Hello Stefan,

I've uploaded my script.  Right now, it exports everything as black, but it
seems to work fine in Ldraw (you can change the color after the fact).  If
you run the resultant file through Edger, Ldview will smooth it properly.
Also, it only exports the main object you have selected in Blender.

I just tested your script (on VERY simple objects, I'm a complete noob with
Blender!), it worked very well. A few things I noticed:
- Export color here is not black but color 16. This is the "main color" that
should be used for triangle and quads in LDraw parts, so this is the best choice
you can do!
- Your script can export very distorted quads (non-flat), this is something you
should take care of (split them into triangles). Or maybe there is an option in
Blender for that? See http://www.ldraw.org/Article512.html#coplanar and
http://philohome.com/isecalc/planarcheck.htm


The next two things to work on are firstly, I'd like to incorporate the Edger
code directly into the script.  Quite honestly though, I just flat don't know
how Edger does what it does, since I'm new to programming, so it's above my
head at the moment.  I'd very much appreciate help in this department.

I have not looked closely into Edger code, but a basic version could be done
like this: for each facet, search all other facets for a common edge. This edge
defines the first two points of the conditional line. Now take one point in each
facet not located on common edge. These are the two control points of the
conditional line.

You may have a look to OLC as another implementation of a condline generator:
http://philohome.com/isecalc/olc.htm

The first improvement to this basic scheme is to suppress condline generation
when the two facets are coplanar. Another one is to create a regular (type 2)
line in place of a condline when angle between facets is sharper than some (user
definable) threshold.

You may also find inspiration in stl2dat tool:
http://marc.klein.free.fr/lego/stl2dat/stl2dat.html

Philo



Message has 1 Reply:
  Re: Blender to LDraw exporter (Blend2Dat v0.2)
 
(...) Haha I knew there was a reason I did that. :) (...) giant file, and can introduce undesirable smoothing artifacts. Generally, it is considered "good form" to ensure there are no coplanar quads when you are modeling something. Perhaps a (...) (16 years ago, 16-Jul-08, to lugnet.cad)

Message is in Reply To:
  Re: Blender to LDraw exporter (Blend2Dat v0.2)
 
Hi again, I've uploaded my script. Right now, it exports everything as black, but it seems to work fine in Ldraw (you can change the color after the fact). If you run the resultant file through Edger, Ldview will smooth it properly. Also, it only (...) (16 years ago, 15-Jul-08, to lugnet.cad, FTX)

9 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR