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/reproducibilitystamp/SMI2016_Extrinsic
25 June 2024, 02:42:34 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    No releases to show
  • 47cfb75
  • /
  • ReadMe.txt
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:98387a4deba1c8d133950ed8d3976e96a0a70a0b
origin badgedirectory badge
swh:1:dir:47cfb752b14bbffdfb86dc1cee16941f8e8821ec
origin badgerevision badge
swh:1:rev:8b0c61f321a3f2f5951455b6e84ea9744048e9e2
origin badgesnapshot badge
swh:1:snp:e50443a166004c44876c1161db97937adc591b38

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: 8b0c61f321a3f2f5951455b6e84ea9744048e9e2 authored by adshhzy on 27 May 2016, 20:29:00 UTC
f
Tip revision: 8b0c61f
ReadMe.txt
Extrinsic - Zhiyang Huang (2016)

------------------------------------

This code implements the algorithm described in

   Huang Z, Ju T. Extrinsically smooth direction fields. Comput Graph(2016), http://dx.doi.org/10.1016/j.cag.2016.05.015i

The basic function of this program is to compute extrinsically smooth direction fields “g” upon a curve, surface or volume while giving a references field “f”, such that “g” is orthogonal to “f”. In particular, the default setting of “f” for curve and surface are tangent field of the curve and normal field of the surface, respectively.

The parameter-free initialization method based on least eigenvector problem and the Gauss–Seidel iterations, as described in the above paper, are implemented in this code and subjected to use.

Currently the code is only tested on Mac OS X 10.10 or above, it should work at other platforms with minor modification.


BUILDING
======================================================================================================


The code has only one dependency: Eigen/Eigen3

Eigen is a C++ template library for linear algebra, and it is a header-based library which can be use right away without binary library to link to, and no configured header file. For different platforms, it should work without modification. See http://eigen.tuxfamily.org/index.php?title=Main_Page for further instruction.

For your convenience, we include the Eigen3 files in the repository. You can use other version of the Eigen3, but be sure to change the path (EIGEN_PATH) in Makefile if you place it in a different folder.

To build the program, just simply type

	$make

in the root directory.  The result will be an executable called “extrinsic” (or “extrinsic.exe” on Windows if it is successfully built).


RUNNING
======================================================================================================

To run the code from the command line, type

	$./extrinsic -i input_file_name -o output_file_name [-e] [-g]

where:
1. -i: followed by the path of the input file. input_file_name is a path to the input file, currently support file format includes “.off”, “.obj”, “.curf”, “.surf”, “.volf”;
 
2. -o: followed by the path of the output file. output_file_name is a path to the output file, you don’t need to specify the extension of the output file, the program will define it to be either “.curf”, “.surf” or “.volf”, according to the input file. If this argument is missed, the default output will be “./output”.

3. -e: optional argument. If -e is included in the command line, the “eigenvector initialization” will be run, otherwise the direction filed will be randomly initialized. 

4. -g: optional argument. If -g is included in the command line, Gauss–Seidel iterations will be run at the initialization field until converge or exceed max iterations.

(The detail format of “.curf”, “.surf”, “.volf” can be found below.)

*An additional output call “output_file_name.ply” will be created for a rough visualization of the generated field, which can be viewed in standard mesh viewers.

*Currently we use a build-in solver in Eigen to compute the least eigenvector (solve sparse linear equations), to further speed it up, you can use any other solvers. We recommend the SuiteSparse, whose wrapper has been already provided in Eigen3.



Generating figures in the paper
======================================================================================================

To generate files for related figures in the paper, type in the root directory:

	$chmod +x makefigure.sh
	$./makefigure.sh

Be sure that the program has been built in the root directory, and the “input” folder, “output” folder are in the same root directory.

Noted that for generating the files for some figures (e.g fig 5, Biarc), we directly build the model in the program and do not require a input model.

Two output files will be generated in “output” folder as “figx_x.curf” (or “figx_x.surf”, “figx_x.volf”), and “figx_x.ply”. The “figx_x.ply” can be opened at standard mesh viewers, but the rendering effect may be different from the exact corresponding figure in the paper.



FORMAT
======================================================================================================

.curf:

“.curf” file mimics the format of “.obj” (see https://en.wikipedia.org/wiki/Wavefront_.obj_file) with partial and modified key words:

v vx vy vz                  v -0.404425 -0.176438 0.554655
e v1 v2           =====>    e 1 20
vn vnx vny vnz    =====>    vn -0.00612673 -0.0156757 0.999858
vf vfx vfy vfz              vf -0.214613 0.652417 0.726838

where:
key word “v” is followed by x, y, z coordinate of a vertex;
key word “e” is followed by the index of vertices which make up the edge;
key word “vn” is followed by the x, y, z coordinate of the reference vector “f” on a vertex (curve tangent by default);
key word “vf” is followed by the x, y, z coordinate of the generated vector which is orthogonal to “vn”, on a vertex;
The order of “vn” and “vf” must follow the order of “v”, which means that the reference vector/field maps to the each vertex orderly.

————————————————————————————————————————————————————————————————————————————————————————————————————
.surf:

“.surf” file mimics the format of “.obj” with partial and modified key words:

v vx vy vz                  v -0.404425 -0.176438 0.554655
f v1 v2 v3        =====>    f 1 20 34
vn vnx vny vnz    =====>    vn -0.00612673 -0.0156757 0.999858
vf vfx vfy vfz              vf -0.214613 0.652417 0.726838

where:
key word “v” is followed by x, y, z coordinate of a vertex;
key word “f” is followed by the index of the three vertices which make up the triangle;
key word “vn” is followed by the x, y, z coordinate of the reference vector “f” on a vertex (surface normal by default);
key word “vf” is followed by the x, y, z coordinate of the generated vector which is orthogonal to “vn”, on a vertex;
The order of “vn” and “vf” must follow the order of “v”, which means that the reference vector/field maps to the each vertex orderly.

————————————————————————————————————————————————————————————————————————————————————————————————————
.volf:

“. volf” file mimics the format of “.obj” with partial and modified key words:

v vx vy vz                      v -0.404425 -0.176438 0.554655
tet v1 v2 v3 v4       =====>    tet 1 20 34 565
vn vnx vny vnz        =====>    vn -0.00612673 -0.0156757 0.999858
vf vfx vfy vfz                  vf -0.214613 0.652417 0.726838

where:
key word “v” is followed by x, y, z coordinate of a vertex;
key word “tet” is followed by the index of the four vertices which make up the tetrahedra;
key word “vn” is followed by the x, y, z coordinate of the reference vector “f” on a vertex;
key word “vf” is followed by the x, y, z coordinate of the generated vector which is orthogonal to “vn”, on a vertex;
The order of “vn” and “vf” must follow the order of “v”, which means that the reference vector/field maps to the each vertex orderly.

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