public double[] Parameters(Snap.Position point) { IntPtr ptr; UFEvalsf evalsf = Globals.UFSession.Evalsf; //evalsf.Initialize2(base.NXOpenTag, out ptr); evalsf.Initialize(base.NXOpenTag, out ptr); double[] array = point.Array; UFEvalsf.Pos3 pos = new UFEvalsf.Pos3(); evalsf.FindClosestPoint(ptr, array, out pos); double[] uv = pos.uv; uv[0] = this.FactorU * uv[0]; uv[1] = this.FactorV * uv[1]; return(uv); }
private static Vector[] SurfaceEvaluate(Snap.NX.Face face, int mode, double u, double v) { IntPtr ptr; double[] numArray = new double[] { u / face.FactorU, v / face.FactorV }; UFEvalsf evalsf = Globals.UFSession.Evalsf; Tag nXOpenTag = face.NXOpenTag; //evalsf.Initialize2(nXOpenTag, out ptr); evalsf.Initialize(nXOpenTag, out ptr); ModlSrfValue value2 = new ModlSrfValue(); evalsf.Evaluate(ptr, mode, numArray, out value2); Vector vector = new Vector(value2.srf_pos); Vector vector2 = new Vector(value2.srf_du); Vector vector3 = new Vector(value2.srf_dv); Vector vector4 = new Vector(value2.srf_unormal); vector2 = (Vector)((1.0 / face.FactorU) * vector2); vector3 = (Vector)((1.0 / face.FactorV) * vector3); return(new Vector[] { vector, vector2, vector3, vector4 }); }