Exemplo n.º 1
0
 public void Assign(EdgePointList rayList)
 {
     foreach (EdgePoint ray in rayList.EdgePoints)
     {
         ray.UVCoords = Coords(ray.Vertex);
     }
 }
Exemplo n.º 2
0
        internal Face(SU.FaceRef suFaceRef)
        {
            // Get its UVHelper for texture-mapping coordinates.

            UVHelper uvh = new UVHelper(suFaceRef);

            // Get the outer loop.

            EdgePointList edgePointList = new EdgePointList(suFaceRef);

            uvh.Assign(edgePointList);

            outerLoop = new Loop(edgePointList).edgePoints;

            // Get any inner loops.

            SU.FaceGetNumInnerLoops(suFaceRef, out long count);

            SU.LoopRef[] loopRefs = new SU.LoopRef[count];

            long len = count;

            SU.FaceGetInnerLoops(suFaceRef, len, loopRefs, out count);

            foreach (SU.LoopRef loopRef in loopRefs)
            {
                innerLoops.Add(
                    new Loop(new EdgePointList(loopRef)).edgePoints);
            }

            SU.MaterialRef suMaterialRef = new SU.MaterialRef();

            try
            {
                SU.FaceGetFrontMaterial(suFaceRef, suMaterialRef);

                SU.StringRef suStringRef = new SU.StringRef();
                SU.StringCreate(suStringRef);

                SU.MaterialGetNameLegacyBehavior(suMaterialRef, suStringRef);

                MaterialName = Convert.ToStringAndRelease(suStringRef);
            }
            catch (SketchUpException e)
            {
                if (e.ErrorCode == SU.ErrorNoData)
                {
                    // Not an error. It just has no material.
                }
                else
                {
                    throw;
                }
            }
        }
Exemplo n.º 3
0
 public Loop(EdgePointList edgePointList)
 {
     this.edgePoints = edgePointList.EdgePoints;
 }