/// <summary> /// Contructor for a spline mesh using the default TubeMesh implementation. /// </summary> /// <param name="spline"></param> /// <param name="crossSectionScale"></param> /// <param name="crossSectionResolution">Number of vertices per circular cross section. /// There will be one more vertex per cross section to create a seam for UV mapping reasons. /// </param> public SplineMesh(Spline spline, Vector3 crossSectionScale, int crossSectionResolution = 6) { List <Vector3> vertices = CircularCrossSection.GenerateVertices(crossSectionResolution); List <Vector3> crossSectionShape = vertices; List <Vector3> crossSectionShapeNormals = new List <Vector3>(); foreach (Vector3 point in crossSectionShape) { crossSectionShapeNormals.Add(point.normalized); } Spline = spline; TubeMesh = new TubeMesh(crossSectionShape, crossSectionShapeNormals, crossSectionScale); //TubeMesh = new ParallelTransportTubeMesh(new CrossSection(crossSectionShape, crossSectionShapeNormals, crossSectionScale)); }
/// <summary> /// Contructor for setting a specific ITubeMesh implementation. /// </summary> /// <param name="spline">The spline implementation to be used.</param> /// <param name="tubeMesh">The <see cref="ITubeMesh"/> implementation to use.</param> public SplineMesh(Spline spline, ITubeMesh tubeMesh) { this.Spline = spline; this.TubeMesh = tubeMesh; }