DXF and Face3D [message #49912] |
Wed, 30 August 2006 07:03  |
Thomas Launey
Messages: 25 Registered: September 1999
|
Junior Member |
|
|
Hello,
I am trying to smooth all the mesh (Face3d) objects in a DXF file using
the code below.
It fails however when I try to put the modified vertices back into the
DXF object with the message:
IDL> test_IDLffDXF
% Loaded DLM: DXF.
% IDLFFDXF::PUTENTITY: DXF error: FACE3D connectivity list must contain
only 4-vertex polygons.
% Execution halted at: TEST_IDLFFDXF 18 H:\test_idlffdxf.pro
Pro test_IDLffDXF
DXF_file=dialog_pickfile(filter="*.DXF", /must_exist)
If N_elements(DXF_file) LT 1 then return
oDXF = OBJ_NEW('IDLffDXF')
status = oDXF->Read(DXF_file)
DXFTypes = oDXF->GetContents()
;*** get all face3D entities
DXFsurface = oDXF->GetEntity(DXFTypes[where(DXFTypes EQ 10)])
vertices = DXFsurface.vertices
connectivity = DXFsurface.connectivity
N_object=n_elements(vertices)
For i=0, N_object-1 do Begin
vert=MESH_SMOOTH (*vertices[i], *connectivity[i])
*((DXFsurface.vertices)[i])=vert
EndFor
oDXF->PutEntity,DXFsurface
End
It seems that all I am doing is to move around the vertices, without
changing the number of faces. A post by K. Schultz from June 2004
suggests to change the type to 9 (polygon) but also warn of potential
problems with running vertices through the tessellator.
Any help would be greatly appreciated :-)
Thanks,
Thomas
|
|
|