Example #1
0
            /// <summary>
            ///
            /// </summary>
            /// <param name="mesh"></param>
            /// <param name="target"></param>
            /// <param name="features"></param>
            /// <param name="tolerance"></param>
            public Solver(HeMesh mesh, MeshFeature target, IEnumerable <IFeature> features, double tolerance = 1.0e-4)
            {
                mesh.Compact();

                _mesh      = mesh;
                _verts     = _mesh.Vertices;
                _hedges    = _mesh.Halfedges;
                _settings  = new Settings();
                _stepCount = 0;

                Target = target;
                InitFeatures(features, tolerance);

                // start on features
                ProjectToFeatures();
            }
        /// <summary>
        ///
        /// </summary>
        /// <param name="mesh"></param>
        /// <param name="target"></param>
        /// <param name="features"></param>
        /// <param name="tolerance"></param>
        public DynamicRemesher(HeMeshSim mesh, MeshFeature target, IEnumerable <IFeature> features, double tolerance = 1.0e-4)
        {
            _mesh   = mesh;
            _verts  = _mesh.Vertices;
            _hedges = _mesh.Halfedges;
            _faces  = _mesh.Faces;

            // triangulate all faces starting with the shortest diagonal
            _mesh.TriangulateFaces(FaceTriangulators.Strip.CreateFromMin(mesh, he => he.Start.Position.SquareDistanceTo(he.NextInFace.End.Position)));

            // initialize features
            _target = target;
            InitFeatures(features, tolerance);

            _settings  = new DynamicRemesherSettings();
            _stepCount = 0;
        }
Example #3
0
            /// <summary>
            ///
            /// </summary>
            /// <param name="mesh"></param>
            /// <param name="target"></param>
            /// <param name="features"></param>
            /// <param name="tolerance"></param>
            public Solver(HeMesh mesh, ISurfaceFeature target, IEnumerable <IFeature> features = null, Settings settings = null)
            {
                if (features == null)
                {
                    features = Enumerable.Empty <IFeature>();
                }

                _mesh = mesh;
                _mesh.Compact();

                _verts     = _mesh.Vertices;
                _hedges    = _mesh.Halfedges;
                _settings  = settings ?? new Settings();
                _stepCount = 0;

                _target = target;
                InitFeatures(features);

                // start on features
                ProjectToFeatures();
            }
Example #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="vertexCapacity"></param>
 /// <param name="hedgeCapacity"></param>
 public HeStructure(int vertexCapacity = DefaultCapacity, int hedgeCapacity = DefaultCapacity)
     : base(hedgeCapacity)
 {
     _vertices = new HeNodeList <V, E>(vertexCapacity);
 }