comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Mesh decimate for DXF data formats
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Mesh decimate for DXF data formats [message #37292] Thu, 11 December 2003 12:21 Go to previous message
Karl Schultz is currently offline  Karl Schultz
Messages: 341
Registered: October 1999
Senior Member
"Neil" <nasalmon@onetel.net.uk> wrote in message
news:74039481.0312110929.20aab1fc@posting.google.com...
> Can i effectively use the IDL routine "Mesh Decimate" to reduce the
> number of vertices in an intelligent way in the DXF representation
> format for polygons? The problem being that now that i can get hold of
> 3DS files convert them to DXF, resulting in amouts of data that are
> too large to handle. I need to cut the number of vertices, but in an
> intelligent way. What this effectively amounts to doing is a kind of
> spatial filtering. You can use Mesh Decimate to reduce the number of
> vertices, but when i tried it for an aircraft it took an important
> artifact away - the wings. Is there some way of reducing the no of
> vertices, but for example leave the lowest spatial frequencies, ie the
> bigger and more important entities.

This is exactly what MESH_DECIMATE is good for. Did you set too low of a
value for PERCENT_VERTICES or PERCENT_POLYGONS?

Basically what it does is compute the cost of performing an edge collapse in
the mesh, which removes a vertex. The cost represents how much the original
mesh differs from the mesh with the collapsed edge. The vertex collapse
that is the cheapest is then performed and then the process is repeated
until the mesh is the desired size.

You should get really good results for reasonable PERCENT values. Once you
get into very small values, things like the wings are less important than
the main body of the plane, so the edges forming the wings and other
*relatively* less important features are going to get removed next.

The algorithm DOES weigh boundary edges as being much more expensive to
remove, so the basic shape should be retained until you get down to the last
few vertices.

I'd really suggest giving it a try with different PERCENT values. You may
have to experiment to get the desired detail with a reasonable number of
vertices. It sort of sounds like you used a very small value like 1 or 2.
Try 10, 20 , or maybe 40.

Karl


>
> Many thanks,
> Neil
>
> "Rick Towler" <rtowler@u.washington.edu> wrote in message
news:<br2jbu$lak$1@nntp6.u.washington.edu>...
>> I am assuming you found openFX. It is not part of IDL but an open
source 3d
>> modeling package. Sorry I didn't make that clear in my original post.
>>
>> As for the vertex and connectivity data, type 9 will do. I don't know
>> exactly what all of the types are and what they would map to in IDL but
we
>> can make a guess. Types 4-8 would be polylines and 9-11 would be
polygons.
>> I would also guess that the block and layer types are for grouping
>> primitives. I'm sure a quick search on the web would clear this up, if
you
>> care as much.
>>
>> I just answered this same question a few weeks back. Google the
newsgroup
>> for it. The short version (for types 4-8 and 9-11) is:
>>
>> dxf_data = obj_new('IDLffDXF', filename)
>> types = dxf_data -> getcontents()
>> entities = dxf_data -> getentity(types[i])
>> data=*(entities.vertices)[j]
>> polylines=*(entities.connectivity)[j]
>>
>> I also have an object that does the work for you. Let me know if you
are
>> interested.
>>
>> Also, google for "3dsrdr.c". This is another way to get at the vertex
and
>> connectivity data for .3ds files.
>>
>>
>> -Rick
>>
>>
>>
>>
>> "Neil" wrote in message...
>>> Does anyone know how i can access polygon connectivity and verticies
>>> from a general DXF file? I use OpenFX to convert a 3DS file to a DXF
>>> file. However, when i read the resulting DXF file using IDL, there is
>>> no DXF Entity type 10 (the 3D face), so i am having difficulty getting
>>> verticies and connectivity. Typical returned Entity Type Nos. are 9,18
>>> and 20, so how can i get connectivity and verticies from theses?
>>>
>>> Many thanks,
>>> Neil
>>>
>>>
>>> (Neil) wrote in message...
>>>> that sounds pretty good, i can get a few more shapes into the model.
>>>> However, i dont see an openFX routine in my current version of IDL.
Is
>>>> this some kind of special or new routine, or can i use IDL to make
>>>> this.
>>>> many thanks,
>>>> Neil
>>>>
>>>> "Rick Towler" wrote in message...
>>>> > "Neil" wrote in message...
>>>> > > Does anyone know the best place to find DXF models of various
>>>> > > geometrical shapes of all kinds? I know the 3DCafe has some free
>>>> > > models, but does anyone know where i can find a greater range?
>>>> >
>>>> > FWIW, I have been casually looking for a good repository of free
3d
>> models
>>>> > on and off for a while and I haven't found any really good sites.
>> There is
>>>> > 3dCafe, and 3dKingdom, and a bunch of sites that post a few models
>> here and
>>>> > there. I usually google then sift thru the results.
>>>> >
>>>> > You can expand your search to include .3ds models and then use
>> something
>>>> > like openFX to convert them to .dxf. This will open up the world
a
>> wee bit
>>>> > more.
>>>> >
>>>> > -Rick
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Porting to VM
Next Topic: rebinning data on new time samples without loops?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 13:30:14 PDT 2025

Total time taken to generate the page: 1.52367 seconds