At the moment I am engaged in creation SolidWorks add-in for exporting 3D models in OBJ format .
OBJ is opened and very simple format
I've googled and found out the following information about existing solutions: there are several paid plugins and 1 free, which is called "Free OBJ Exporter"
It was taken as a basis. But it does not export the decals.
Decals are images you draw on top of the main texture ( if you move away from the context of SolidWorks, in 3D programming it's like a marks of bullets , blood drops , etc.)
Export decals are an important part of the project.
I rewrote all the VBA code into C #.
And now I come to grips with the issue of export decals . Documentation Solidworks API rather poor.
After a week of reading the documentation and a couple of questions on LinkedIn I found the following :
IDecal
is inherided class from IRendererMaterial
. Therefore I can get a list of all the decals and get the following information:
- Yposition
- Xposition
- Width
- Height
I also can get a list of IFace2 objects and get FaceDecalProperties
.
IFaceDecalProperties
provides next information:
TextureTranslationU
TextureTranslationV
TextureTranslationX
TextureTranslationY
TextureUScale
TextureVScale
What it is, what it stands for and how to use it I do not know .
OBJ format does not support directly decals.
How can I use this parameters for concatenation texture and decal in one file? I want to do it for rendering decal on face and solve the problem of Z-fighting, because I don't have source code of renderer.