예제 #1
0
        /// <summary>
        /// Get the cross section.
        /// </summary>
        /// <param name="crossSectionShape">A copy of the cross section shape is assigned to this variable.</param>
        /// <param name="crossSectionShapeNormals">A copy of the cross section normals is assigned to this variable.</param>
        public void GetCrossSectionShape(out List <Vector3> crossSectionShape, out List <Vector3> crossSectionShapeNormals)
        {
            CrossSection crossSection = this.TubeMesh.GetCrossSection();

            crossSectionShape        = crossSection.Vertices;
            crossSectionShapeNormals = crossSection.Normals;
        }
예제 #2
0
        /// <summary>
        /// The diameter of the spline will depend on the native size of the set cross section.
        /// The default circular cross section has a default diameter of 1.
        /// </summary>
        /// <param name="scale"></param>
        public Mesh SetCrossSectionScale(Vector3 scale)
        {
            CrossSection crossSection = TubeMesh.GetCrossSection();

            crossSection.Scale = scale;
            return(TubeMesh.SetCrossSection(Spline.InterpolatedPoints, crossSection));
        }
예제 #3
0
 /// <summary>
 /// Set the cross section and recalculate the mesh for all points.
 /// </summary>
 /// <param name="points"></param>
 /// <param name="crossSection"></param>
 /// <returns></returns>
 public Mesh SetCrossSection(List <Vector3> points, CrossSection crossSection)
 {
     this.CrossSection = crossSection;
     return(this.GenerateMesh(points));
 }
예제 #4
0
 /// <summary>
 /// Contructor.
 /// </summary>
 /// <param name="crossSection">Cross section to be used for the tube mesh.</param>
 /// <param name="generateCaps">Should the ends of the tube be closed?</param>
 public ParallelTransportTubeMesh(CrossSection crossSection, bool generateCaps = true)
 {
     this.CrossSection = crossSection;
     this.GenerateCaps = generateCaps;
 }
예제 #5
0
 /// <summary>
 /// Copy constructor.
 /// </summary>
 /// <param name="crossSection"></param>
 public CrossSection(CrossSection crossSection)
 {
     this.Vertices = new List <Vector3>(crossSection.Vertices);
     this.Normals  = new List <Vector3>(crossSection.Normals);
     this.Scale    = crossSection.Scale;
 }
예제 #6
0
        /// <summary>
        /// Refine the current mesh using the Parallel Transport algorithm.
        /// </summary>
        /// <returns></returns>
        public Mesh RefineMesh()
        {
            CrossSection crossSection = this.TubeMesh.GetCrossSection();

            return(ParallelTransportTubeMesh.GetMesh(Spline.InterpolatedPoints, crossSection.Vertices, crossSection.Normals, crossSection.Scale, true));
        }