本文整理汇总了C#中Face.Evaluate方法的典型用法代码示例。如果您正苦于以下问题:C# Face.Evaluate方法的具体用法?C# Face.Evaluate怎么用?C# Face.Evaluate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Face
的用法示例。
在下文中一共展示了Face.Evaluate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setupParticleSystem
void setupParticleSystem(Face f, int uDiv, int vDiv, double springDampening, double springRestLength, double springConstant, double mass)
{
BoundingBoxUV bbox = f.GetBoundingBox();
double uStep = (bbox.Max.U - bbox.Min.U)/uDiv;
double vStep = (bbox.Max.V - bbox.Min.V)/vDiv;
for (int j = 0; j <=uDiv; j++) // Y axis is outer loop
{
double u = bbox.Min.U + uStep * j;
for (int i = 0; i <= vDiv; i++) // X axis is inner loop
{
double v = bbox.Min.V + vStep * i;
Particle a = particleSystem.makeParticle(mass, f.Evaluate(new UV(u, v)), false);
if(i > 0)
{
particleSystem.makeSpring(particleSystem.getParticle((i - 1) + (j * (vDiv+1))), a, springRestLength, springConstant, springDampening);
}
if (j > 0)
{
Particle b = particleSystem.getParticle(i + ((j - 1) * (vDiv+1)));
particleSystem.makeSpring(a, b, springRestLength, springConstant, springDampening);
}
if (i == 0 || i == vDiv || j==0 || j==uDiv)
{
a.makeFixed();
}
}
}
}
示例2: ComputeValueAtPointForFace
/// <summary>
/// Compute the value of face on specific point
/// </summary>
/// <param name="face"></param>
/// <param name="uvPts"></param>
/// <param name="valList"></param>
/// <param name="measurementNo"></param>
private static void ComputeValueAtPointForFace(Face face, out IList<UV> uvPts, out IList<ValueAtPoint> valList, int measurementNo)
{
List<double> doubleList = new List<double>();
uvPts = new List<UV>();
valList = new List<ValueAtPoint>();
BoundingBoxUV bb = face.GetBoundingBox();
for (double u = bb.Min.U; u < bb.Max.U + 0.0000001; u = u + (bb.Max.U - bb.Min.U) / 1)
{
for (double v = bb.Min.V; v < bb.Max.V + 0.0000001; v = v + (bb.Max.V - bb.Min.V) / 1)
{
UV uvPnt = new UV(u, v);
uvPts.Add(uvPnt);
XYZ faceXYZ = face.Evaluate(uvPnt);
// Specify three values for each point
for (int ii = 1; ii <= measurementNo; ii++)
doubleList.Add(faceXYZ.DistanceTo(XYZ.Zero) * ii);
valList.Add(new ValueAtPoint(doubleList));
doubleList.Clear();
}
}
}