gradientspace / geometry3Sharp

C# library for 2D/3D geometric computation, mesh algorithms, and so on. Boost license.
http://www.gradientspace.com
Boost Software License 1.0
1.71k stars 387 forks source link

Getting Error in Unity #175

Open AcKeskin opened 2 years ago

AcKeskin commented 2 years ago

I get the following error even though I have added "G3_USING_UNITY" to the Scripting Define Symbols NotSupportedException: ToVector3d: unknown type UnityEngine.Vector3 g3.BufferUtil.ToVector3d[T] (System.Collections.Generic.IEnumerable1[T] values) (at Assets/Scripts/geometry3sharp/core/BufferUtil.cs:210) g3.DMesh3Builder.Build[VType,TType,NType] (System.Collections.Generic.IEnumerable1[T] Vertices, System.Collections.Generic.IEnumerable1[T] Triangles, System.Collections.Generic.IEnumerable1[T] Normals, System.Collections.Generic.IEnumerable1[T] TriGroups) (at Assets/Scripts/geometry3sharp/mesh/DMesh3Builder.cs:170) Ekran görüntüsü 2022-03-16 170025 `

firdiar commented 2 years ago

Have you add the namespace in the script

using g3;
runette commented 1 year ago

How are you installing it?

You have to install it as source and not as the .dll from Nuget - to allow the compile symbols to work.

There is a UPM package available that correctly installs in Unity (but you still the Compile Symbol) :

https://openupm.com/packages/com.virgis.geometry3sharp/