.NET

Reply
Active Contributor pfk
Active Contributor
pfk
Posts: 34
Registered: ‎02-11-2013
Message 1 of 8 (437 Views)

Obtaining texture UV coordinates

437 Views, 7 Replies
09-05-2013 09:19 PM

Hi

 

I am trying to write a 3d geometry exporter for AutoCAD.

 

Firstly, is iterating through the document database, and processing any Solid3d, Region & Body entities the best way to do this, or is there a faster way to access the 3d geometry?

 

Secondly, I assume using the first approach above, I need to process each entity as a Brep in order to get the vertices, polygons, etc.  In this case, how are the UV coordinates for each vertex obtained pls?

 

Thanks

Active Contributor pfk
Active Contributor
pfk
Posts: 34
Registered: ‎02-11-2013
Message 2 of 8 (397 Views)

Re: Obtaining texture UV coordinates

09-12-2013 05:58 PM in reply to: pfk

Bumping - still looking for a method to get UV coordinates from polygons in AutoCAD.

 

Can anyone assist pls?

 

Thanks

ADN Support Specialist
Balaji_Ram
Posts: 715
Registered: ‎03-21-2011
Message 3 of 8 (373 Views)

Re: Obtaining texture UV coordinates

09-24-2013 11:16 PM in reply to: pfk

Sorry for the delay.

 

By UV coordinates, do you mean the pixel coordinates in the image that was used as a texture for the polygon ?

 

Sorry, if I did not understand your question. If you can provide more details with drawings, texture image and clear steps about what you are trying to retrieve from that drawing, that will help.

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Member
pkinnane
Posts: 4
Registered: ‎02-14-2013
Message 4 of 8 (363 Views)

Re: Obtaining texture UV coordinates

09-25-2013 04:35 PM in reply to: Balaji_Ram

Hi

 

Thanks for your response.

 

I want to export AutoCAD geometry to an OBJ file, and want to include the UV texture mapping coordinates in the OBJ file.  When exporting a Nurbs Surface, using nurbSurface.GetParameterOfPoint(point3d, out u, out v); to get the UV returns the point on the Nurb surfaces, but this is not the UV texturemapping coordinate (since this is in the MaterialMapper a a transform).  Often the uv's from GetParameterOfPoint are rotated 90 degrees away from what the AutoCAD viewport is displaying (presumeably because the MaterialMapper transform contains a rotation).

 

How can I use the u/v returned by GetParameterOfPoint to calculate the uv texturemap coordinate via the MaterialMapper pls?

 

Also, for Meshes, there is no surface, so how can the UV texturemap coordinate be returned for these geometry items?

 

Thanks

Member
pkinnane
Posts: 4
Registered: ‎02-14-2013
Message 5 of 8 (357 Views)

Re: Obtaining texture UV coordinates

09-25-2013 06:38 PM in reply to: pkinnane

Sorry - replied from the wrong account - this is the original poster.

ADN Support Specialist
Balaji_Ram
Posts: 715
Registered: ‎03-21-2011
Message 6 of 8 (336 Views)

Re: Obtaining texture UV coordinates

09-27-2013 05:32 AM in reply to: pfk

Hi,

 

Sorry for the delay. I have spent some time trying to understand the transform provided by the material mapper.

 

Although the transform provides the offset, scale and rotation values, AutoCAD also considers other inputs such as tiling and type of projection while mapping material on to the mesh. 

 

I still cannot figure out a way to know the texture image coordinates corresponding to a given point on the mesh. I have contacted our engineering team to know if there is a way to get this information. I will keep you updated after I get a response.

 

Regards,

 



Balaji
Developer Technical Services
Autodesk Developer Network

ADN Support Specialist
Balaji_Ram
Posts: 715
Registered: ‎03-21-2011
Message 7 of 8 (317 Views)

Re: Obtaining texture UV coordinates

09-28-2013 10:39 PM in reply to: pfk

Hi,

 

Based on what I heard from our engineering team, it is not possible to get the texture coordinates from the geometry coordinates. The texture map transform along with other parameters such as tiling and projection make it a complex transformation which is not possible to get at present using the API.

 

Sorry about that.

 

Regards,



Balaji
Developer Technical Services
Autodesk Developer Network

Member
pkinnane
Posts: 4
Registered: ‎02-14-2013
Message 8 of 8 (310 Views)

Re: Obtaining texture UV coordinates

09-29-2013 04:12 PM in reply to: Balaji_Ram

Thank you Balaji.  I appreciate the effort you've taken to look into this.  Obtaining texture coordinate UV's from the Revit and Inventor API's is quite straighforward, so hopefully the AutoCAD API team will consider adding this to a future version of AutoCAD, because it would be very useful.

 

Thanks again.

 

Paul

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.