Beispiel #1
0
        public override IEnumerator BeginGeneration()
        {
            var surface         = surfaceInputSlot.GetAsset <Surface>();
            var topology        = topologyInputSlot.GetAsset <Topology>();
            var vertexPositions = vertexPositionsInputSlot.GetAsset <IEdgeAttribute <Vector3> >();
            var facePositions   = facePositionsInputSlot.GetAsset <IFaceAttribute <Vector3> >();
            var bisectors       = Vector3EdgeAttribute.Create(topology.faceEdges.Count);

            EdgeAttributeUtility.CalculateFaceEdgeBisectorsFromVertexPositions(topology.internalFaces, surface, vertexPositions, facePositions, bisectors);
            bisectorsOutputSlot.SetAsset(bisectors);

            yield break;
        }
Beispiel #2
0
        public override IEnumerator BeginGeneration()
        {
            var topology        = topologyInputSlot.GetAsset <Topology>();
            var vertexPositions = vertexPositionsInputSlot.GetAsset <IEdgeAttribute <Vector3> >();
            var offsets         = offsetsInputSlot.GetAsset <IEdgeAttribute <Vector3> >();
            var offsetPositions = Vector3EdgeAttribute.Create(topology.faceEdges.Count);

            foreach (var edge in topology.faceEdges)
            {
                offsetPositions[edge] = vertexPositions[edge] + offsets[edge] * scale;
            }
            offsetVertexPositionsOutputSlot.SetAsset(offsetPositions);

            yield break;
        }