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

https://github.com/HTDerekLiu/surface_multigrid_code
18 May 2026, 21:33:02 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/main
    No releases to show
  • 337a0c0
  • /
  • 02_mg_hierarchy
  • /
  • main.cpp
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

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
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:5b9144673708d65fb3d5600ac901331cd3d5f4f2
origin badgedirectory badge
swh:1:dir:2bca4fcfada943370b952ba16f51b9a665d9118a
origin badgerevision badge
swh:1:rev:adc49abe10a97200a3a5735bd370e98560091a37
origin badgesnapshot badge
swh:1:snp:ddc1cedc37ffd7f3dfc9f5e01222a2486b0425f7

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
  • revision
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: adc49abe10a97200a3a5735bd370e98560091a37 authored by Hsueh-Ti Derek Liu on 16 March 2023, 20:37:42 UTC
Merge pull request #3 from alecjacobson/main
Tip revision: adc49ab
main.cpp
#include <igl/read_triangle_mesh.h>

#include <igl/opengl/glfw/Viewer.h>

#include <Eigen/Dense>
#include <Eigen/Core>
#include <Eigen/Sparse>

#include <iostream>
#include <vector>

#include <mg_data.h>
#include <mg_precompute.h>

int main(int argc, char *argv[])
{
	using namespace Eigen;
	using namespace std;

	// load mesh
	MatrixXd VO,V;
	MatrixXi FO,F;
	{
		igl::read_triangle_mesh("../../meshes/bunny.obj", VO, FO);
		cout << "original mesh: |V| " << VO.rows() << ", |F|: " << FO.rows() << endl;
	}

	// construct the multigrid hierarchy
	int min_coarsest_nV = 500;
	float coarsening_ratio = 0.25;
	int decimation_type = 1;
	vector<mg_data> mg;
	mg_precompute(VO,FO,coarsening_ratio, min_coarsest_nV, decimation_type, mg);

	// Visualize the self parametrization
	MatrixXd pt;
	igl::opengl::glfw::Viewer viewer;
	viewer.data().set_mesh(mg[0].V, mg[0].F);
	viewer.callback_key_down =
	[&](igl::opengl::glfw::Viewer & viewer, unsigned char key, int mod)->bool
	{
		switch(key) {
			case '0':
				viewer.data().clear();
				viewer.data().set_mesh(mg[0].V,mg[0].F);
				break;
			case '1':
				pt = mg[1].P * mg[1].V;
				viewer.data().clear();
				viewer.data().set_mesh(mg[1].V,mg[1].F);
				viewer.data().add_points(pt, Eigen::RowVector3d(0, 0, 0));
				viewer.data().point_size = 7;
				break;
			case '2':
				pt = mg[2].P * mg[2].V;
				viewer.data().clear();
				viewer.data().set_mesh(mg[2].V,mg[2].F);
				viewer.data().add_points(pt, Eigen::RowVector3d(0, 0, 0));
				viewer.data().point_size = 10;
				break;
			default:
				return false;
		}
		return true;
	};
	viewer.launch();
	
}

back to top

Software Heritage — Copyright (C) 2015–2026, 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