Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • adfc2e5
  • /
  • nurbs_plugin
  • /
  • BoundaryFitting.h
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:e131882b838ba94804d86d4f2271ef051ce073e2
directory badge Iframe embedding
swh:1:dir:1527aafa4f478fbed854d026dc9a61c6f21f769d

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
BoundaryFitting.h
#pragma once

#include "SurfaceMeshModel.h"
#include "FaceBarycenterHelper.h"

#include "NanoKdTree.h"
#include "../CustomDrawObjects.h"

typedef QPair<Halfedge,double> HalfedgeTime;
typedef QMap<double, HalfedgeTime > DistanceHalfedge;

struct BoundaryFitting{

    BoundaryFitting( SurfaceMeshModel * mesh = NULL, int numSegments = 20, int numSegmentsV = -1);
	void doFit();

	std::vector<SurfaceMesh::Vertex> collectRings( SurfaceMesh::Vertex v, size_t min_nb, bool isBoundary = false );
	
	QVector<SurfaceMesh::Vertex> boundaryVerts();

	void normalize( SurfaceMesh::ScalarVertexProperty & vprop );

	void gradientFaces( ScalarVertexProperty & functionVal, bool isSmooth = true, bool isNormalizeNegateGradient = true );
	QVector<SurfaceMesh::Vertex> neighbours( int start, int range, QVector<SurfaceMesh::Vertex> all );

	SurfaceMesh::Halfedge get_halfedge(SurfaceMesh::Vertex start, SurfaceMesh::Vertex end);
	SurfaceMesh::Halfedge getBestEdge(Vector3d prevPoint, Vector3d direction, Face f, double & bestTime);
	SurfaceMesh::Face getBestFace( Vector3d & point, Vertex guess );

	std::vector<Vector3d> geodesicPath(Vector3d fromPoint, Vector3d toPoint);
	std::vector< std::vector<Vector3d> > geodesicPaths( std::vector<Vector3d> fromPoints, std::vector<Vector3d> toPoints, int segments = -1 );

	std::vector<Vector3d> trianglePoints( Face f );
	std::vector<Vertex> triangleVertices( Face f );

	SurfaceMesh::SurfaceMeshModel * part;
	int segments, segmentsV;

	SurfaceMesh::ScalarVertexProperty vals;
	SurfaceMesh::ScalarVertexProperty boundaryCurv;
	SurfaceMesh::ScalarVertexProperty dists;
	SurfaceMesh::Vector3VertexProperty vgradient;

	SurfaceMesh::Vector3FaceProperty fgradient;
	SurfaceMesh::Vector3VertexProperty vdirection;
	SurfaceMesh::Vector3VertexProperty normals;
	SurfaceMesh::Vector3VertexProperty points;

	NanoKdTree tree;

	// output
	std::vector< std::vector<Vector3d> > lines;

	std::vector<Vector3d> debugPoints, debugPoints2;
	std::vector<Vector3d> corners;
	std::vector< std::vector<Vector3d> > main_edges;
	LineSegments ls;
};

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API