Posts: 94
Threads: 32
Joined: Nov 2019
Reputation:
0
I everybody,
I'm a new member and i suppose i need your help.
I try to read a 'STL' file using assimp libs but i receive an error creating reference for Assimp64.dll
Visual studio tells me that the componend is not valid. Why?
My project is a vb form project in visual studio 2017
Anyone can help me?
Posts: 738
Threads: 8
Joined: Sep 2009
Reputation:
45
To use assimp library you need to add references to AssimpNet.dll and Ab3d.PowerToys.Assimp. Then you need to make sure that the Assimp64.dll in copied to the same folder as the exe of your project - this can be achieved with setting the Assimp64.dll file as "Content" and "Copy if newer" (in the Visual Studio file properties). Note that if you will only use Assimp64.dll, then you also need to set your application to be compiled only for x64 and not for AnyCPU.
Andrej Benedik
Posts: 94
Threads: 32
Joined: Nov 2019
Reputation:
0
Do you tell me not to add a reference on the proj just copy .dll in bin folder?
Thank you, May be i will need a little help in the future...?
Posts: 738
Threads: 8
Joined: Sep 2009
Reputation:
45
Yes, Assimp64 is not a .Net assembly (dll) but a a native dll (C++ project) so it cannot be added as a reference. But it needs to be available so that .net can load it - it is best to be in the same folder as exe. In this case the library will be automatically loaded. But if you want you can also put it into some other folder and then load the library with calling: AssimpWpfImporter.LoadAssimpNativeLibrary(assimp32Folder, assimp64Folder);
Andrej Benedik
Posts: 94
Threads: 32
Joined: Nov 2019
Reputation:
0
11-04-2019, 10:30 AM
(This post was last modified: 11-04-2019, 11:41 AM by kreativasas.)
Perfect! It works!
I wrote my 'hello world' code to read STL files
<code> Dim myimporter As New AssimpWpfImporter
myimporter.ReadFileToAssimpScene("final_Mandibolare.stl")'</code>
No error found but i don't know how visualiza the scene.
I created an 'elementhost' control bu i can't display nothing.
Can i have some example code in winform to load, display and manipulate the 3D scene?
Thanks!
Posts: 94
Threads: 32
Joined: Nov 2019
Reputation:
0
No matter, i solved!
I used Ab3d.Visuals.AssimpModelVisual3D to read STL file and show them on a elementhost, but STL are displayed with default material.
Can i modify material for each object in STL file?
Thanks
Posts: 94
Threads: 32
Joined: Nov 2019
Reputation:
0
Ok, but AssimpModelVisual3D is ok for what i have to do.
Just a question.
Can i create handler (mpouseclick, mouseleave) on a AssimpModelVisual3D imported scene?
Posts: 738
Threads: 8
Joined: Sep 2009
Reputation:
45
As you have probably already seen there are many samples in the samples project that demonstrate how to add mouse handlers to 3D objects.
Andrej Benedik
Posts: 94
Threads: 32
Joined: Nov 2019
Reputation:
0
thanks for reply.
I solved my problems... but I'm yet not able to manipulate meshes after reading STL file.
Is there a sample that can help me?