How to create a face with 20 vertex points?

How to create a face with 20 vertex points?

Anonymous
Not applicable
918 Views
7 Replies
Message 1 of 8

How to create a face with 20 vertex points?

Anonymous
Not applicable
Is there a way to create a face which has more than 4 vertices?

I have a face set where most of the faces have 3-4 vertices but sometimes I get a face with e.g. 20 vertices. Those face sets are generated by one 3D design software and I should read in that 3D geometry to the AutoCAD. I am using ObjectARX C++ interfaces.

Those faces can also contain holes so dividing face to several triangles is not so easy.

I hope someone has a solution for this problem..
0 Likes
919 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
Hi Marko, Just use a shell. It warns of being slow with many vertices, but I've never had a problem. (Except using face styles....) "MarkoMattila" wrote in message news:[email protected]... > Is there a way to create a face which has more than 4 vertices? > > I have a face set where most of the faces have 3-4 vertices but sometimes I get a face with e.g. 20 vertices. Those face sets are generated by one 3D design software and I should read in that 3D geometry to the AutoCAD. I am using ObjectARX C++ interfaces. > > Those faces can also contain holes so dividing face to several triangles is not so easy. > > I hope someone has a solution for this problem..
0 Likes
Message 3 of 8

Anonymous
Not applicable
Good Morning Andrew

Is the only way to create a shell, to create a custom entity and implement worldDraw(..) function? I have face set where the data is defined almost in the same way than what is needed to define a shell. So it feels little frustrating if the creation of the custom entity is the only way add shell data to database.

Is there a way for example to create a solid object and then define it to have this shell? A simple example would be nice.

Thanks
0 Likes
Message 4 of 8

Anonymous
Not applicable
I am not aware of any shell database entity... what situation are you in? If you are already creating a custom entity, just save the shell data statically in your entity for draw. Otherwise, you could write your own custom shell entity. It would be easy and quick since you need no user interaction (?). Then just add a shell entity to the db when you want to do this. Beware of overhead though, and try to reuse it if needed! "MarkoMattila" wrote in message news:[email protected]... > Good Morning Andrew > > Is the only way to create a shell, to create a custom entity and implement worldDraw(..) function? I have face set where the data is defined almost in the same way than what is needed to define a shell. So it feels little frustrating if the creation of the custom entity is the only way add shell data to database. > > Is there a way for example to create a solid object and then define it to have this shell? A simple example would be nice. > > Thanks
0 Likes
Message 5 of 8

Anonymous
Not applicable
My situation is: I have face set data (vertices, face descriptions and edge visibility information). Now I need to put this data to the AutoCAD db somehow.

I found the example of how to create a shell and how it can be added to the database (ASDKMAKESHELL). The example worked well, but when I tried to use similar approach in my application, I couldn't add that custom entity to the database. The result was that AutoCAD crashed.

I know that crashing is caused only that custom entity because the db already contains many objects (3500) which my arx application has added to the db.

Is it ok to derive a class from AcDb3dSolid and then implement worldDraw(..) function where I create shell data? Should it work? If I have understood correctly, then my custom object should have the behaviour of the solid object but its geometry is based on the original face set?

I tried this also but adding my custom object to the db, crashed AutoCAD also.

-Marko
0 Likes
Message 6 of 8

Anonymous
Not applicable
I am not really familiar with AcDb3dSolid's, but I think it has a lot to do with the BREP library and a host a parametric functions. I would think making a true solid is more complicated than just overridding the worlddraw functions. Unless you need some advanced solid features, you will probably just want to derive from AcDbEntity. I work in this way with "solid" objects where I just draw a shell and I do all the geomety stuff myself, and it works fine. I guess it just depends on what you need to do. "MarkoMattila" wrote in message news:[email protected]... > My situation is: I have face set data (vertices, face descriptions and edge visibility information). Now I need to put this data to the AutoCAD db somehow. > > I found the example of how to create a shell and how it can be added to the database (ASDKMAKESHELL). The example worked well, but when I tried to use similar approach in my application, I couldn't add that custom entity to the database. The result was that AutoCAD crashed. > > I know that crashing is caused only that custom entity because the db already contains many objects (3500) which my arx application has added to the db. > > Is it ok to derive a class from AcDb3dSolid and then implement worldDraw(..) function where I create shell data? Should it work? If I have understood correctly, then my custom object should have the behaviour of the solid object but its geometry is based on the original face set? > > I tried this also but adding my custom object to the db, crashed AutoCAD also. > > -Marko
0 Likes
Message 7 of 8

Anonymous
Not applicable
If you just need to represent it with AutoCAD entities and don't require a custom object, you should be able to use a PolyFaceMesh (which is a collection of 3 and 4 sided faces. There is an example of making one of these in the sample program ArxDbg. Jim Awe Autodesk, Inc. "MarkoMattila" wrote in message news:[email protected]... > Good Morning Andrew > > Is the only way to create a shell, to create a custom entity and implement worldDraw(..) function? I have face set where the data is defined almost in the same way than what is needed to define a shell. So it feels little frustrating if the creation of the custom entity is the only way add shell data to database. > > Is there a way for example to create a solid object and then define it to have this shell? A simple example would be nice. > > Thanks
0 Likes
Message 8 of 8

Anonymous
Not applicable
Yes, that was my first idea, but then I found out that there were faces with more than 4 faces. I couldn't figure out how to handle these kind of faces when using PolyFaceMesh.

I managed to create a custom solid object (derived from AcDb3dSolid) and I also successfully added it to the db. Should it act like the original solid, because I only reimplemented the worldDraw(..) function (where I created the shell)?

-Marko
0 Likes