Você está na página 1de 64

1

!"#$%&' )*+,-"./&/0*.

1%234!546777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 8
SNALL T0T0RIAL .............................................................................................................................................. 6
TRANSFER F0NCTI0N....................................................................................................................................... 7
EQ0ALIZER.......................................................................................................................................................... 7
696:;21%<7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 =
STRESSINu TBE C0RvAT0RE 0F A NESB ....................................................................................................... 8
uIvINu A T0NE T0 A NESB............................................................................................................................... 8
APPLYINu TBE SANE NAPPINu T0 SEvERAL NESBES ................................................................................. 8
FEAT0RES............................................................................................................................................................ 9
SANPLE 0SAuE................................................................................................................................................... 9
!"#$%#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&'
($)*+, (./"$01.,2$20&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 34
5"6,/ 78)*8#$.$82&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 34
(*,%$"+ 9,".:/,#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 34
P0INT PICKINu T00L..................................................................................................................................... 11
;,#%/$*.$82&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 33
<#, =$.1 >?+$02 @,#1 :#$20 A$%B,C A8$2.#> D$+.,/&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 3E
F8.,# D8/ ;,G,+8*,/# H18 H"2. .8 :#, *$%B,C *8$2.# $2 .1,$/ *+:0$2&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 3E
I.1,/ $2D8/)".$82&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 3E
PREREQ0ISITIES.............................................................................................................................................. 1S
J8+, (,+,%.$82K &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 3L
J8+, 9$++$20K&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 3L
J8+, !/$C0$20K&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 3L
F82 @"2$D8+C J8+, (*+$..$20K&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 3M
;"." (./:%.:/,#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 3M
@"/B $2.,/,#.$20 D"%,# &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 3M
!/$C0,# N:+C$20 $##:,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 3O
P0INT PICKINu T00L..................................................................................................................................... Su
;,#%/$*.$82&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& L4
<#, =$.1 >?+$02 @,#1 :#$20 A$%B,C A8$2.#> D$+.,/&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& L3
F8.,# D8/ ;,G,+8*,/# H18 H"2. .8 :#, *$%B,C *8$2.# $2 .1,$/ *+:0$2&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& L3
I.1,/ $2D8/)".$82&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& L3
N0RPBER T00L.............................................................................................................................................. S1
;,#%/$*.$82&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& L3
;,."$+# &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& L3
I.1,/ $2D8/)".$82&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& LE
>?9%% @2%65;7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 AB
uENERAL BESCRIPTI0N................................................................................................................................. S2
F0NCTI0N FILTER LIST ................................................................................................................................. SS
782G,P J:++ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& LL
;,+":2"6 Q/$"20:+".$82&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& LL
R8/828$ 9$+.,/$20&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& LL
?+*1" (1"*,#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& LM
(,+,%. R$#$N+, A8$2.#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& LO
<9CC:;65) @:;!16<777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 AD
INP0RT............................................................................................................................................................. S6
EXP0RT............................................................................................................................................................. S6
E:!C2%243 )5F5%77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 A8
G?16 H:9 455)77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 A8
2
uETTINu TBE S00RCES.................................................................................................................................. S6
EXTERNAL BEPENBENCIES........................................................................................................................... S7
C0BE TREE STR0CT0RE................................................................................................................................. S7
C0NPILINu....................................................................................................................................................... S8
<#$20 @$%/8#8D. R$#:"+ (.:C$8 S ,P*/,## ,C$.$82 "2C TQ&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& LS
G;26243 1 C%93247777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 AI
NESB BATA STR0CT0RE............................................................................................................................... S9
WRITINu Y00R FIRST FILTER....................................................................................................................... 4u
(RF&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& M4
WBAT IS vCu LIB . ....................................................................................................................................... 4u
INSTALLATI0N ANB F0LBER STR0CT0RE................................................................................................... 41
U,..$20 R7U 5$N&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& M3
98+C,/ (./:%.:/,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& M3
BASIC C0NCEPTS............................................................................................................................................. 41
J8H .8 C,D$2, " ),#1 .6*, &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& M3
J8H .8 %/,"., " ),#1&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ML
Q1, D+"0# 8D .1, ),#1 ,+,),2.# &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ML
J8H .8 */8%,## " ),#1&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ML
0PTI0NAL C0NP0NENT................................................................................................................................ 44
I*.$82"+ 78)*82,2. 9"#.&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& MM
I*.$82"+ 78)*82,2. 78)*"%. &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& MO
<#,/VC,D$2,C "../$N:.,#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& MW
7XX .6*, 8D " ),#1 "2C /,D+,%.$82&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& MY
AB}ACENCY ...................................................................................................................................................... 47
99 ?CZ"%,2%6 &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& MS
R9 ?CZ"%,2%6&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& O4
9,H D"%.# 82 99 "CZ"%,2%6 "2C R9 "CZ"%,2%6&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& O3
!8:2C"/6 /,+".$82# "2C "CZ"%,2%6&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& OE
SPACE C0NCEPTS ............................................................................................................................................ S2
vIEWINu ANB NANIP0LATI0N..................................................................................................................... S2
(18. "2C %"),/"&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& OE
@2%5 @:;!16<7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 DD
SAvINu NASK ANB REABINu NASK............................................................................................................ SS
ERR0R REP0RTINu ........................................................................................................................................ S6
vNI B0NP FILE............................................................................................................................................... S6
1EE5<< 6: !5<?77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 DJ
?%%,##$20 .1, %88/C# 8D "++ .1, G,/.,P,#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& OY
?%%,##$20 "++ .1, D"%,# "2C %8)*:.$20 .1,$/ N"/6%,2.,/ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& OY
7/,".$20 ,+,),2.# &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& OY
;,#./86$20 [+,),2.#&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& OY
AB}ACENCY RELATI0NS ................................................................................................................................. S8
78:2.$20 N8/C,/ ,C0,# \H$.18:. .8*8+806] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& OS
78:2.$20 N8/C,/ ,C0, \:#$20 99 "CZ"%,2%6] &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& OS
%2E54<5< 77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 DI
PRIvACY BISCLAINER.................................................................................................................................... S9
ACKN0WLEBuNENTS..................................................................................................................................... 6u
1 @9%%H E:!C;5?54<2F5 392)5 :4 G;26243 14 2: C%9324 @:; !5<?%1K777777 8L


S
2./M*N,+/0*.

NeshLab is a auvanceu mesh piocessing system, foi the automatic anu usei
assisteu euiting, cleaning, filteiing conveiting anu ienueiing of laige
unstiuctuieu SB tiiangulai meshes. NeshLab is actively uevelopeu by the a small
gioup of people at the visual Computing Lab at the ISTI - CNR institute, a laige
gioup of univeisity stuuents anu some gieat uevelopeis fiom the iest of the
woilu. Foi the basic mesh piocessing tasks anu foi the inteinal uata stiuctuies
the system ielies on the uPL vCu libiaiy.

2./"M&+/0.O P0/$ /$" -"#$

When NeshLab staits you aie in the so-calleu %"),/" )8C, wheie the mouse
actions aie useu to change the way in which you look at the mouel. This mouality
is the uefault anu allows to easily navigate anu inspect youi mouel without
actually mouifying it. The cameia moue is tuineu off when you use one of the
Inteiactive euiting tools, wheie the mouse actions aie inteipieteu in a uiffeient
way (e.g. foi painting the mesh), but you can always switch back to the %"),/"
)8C, by piessing ESC; in this case the euinting tool is just suspenueu anu you
can go back to euiting by piessing again ESC. To exit fiom an euiting tool you
have to piess again the toolbai button that staiteu it.

Stanuaiu
cameia moue
left uiag
;*/&/" oibit aiounu the cuiient centei of the object. Click fai
fiom the centei to iotate aiounu the line of view.
ctil+left uiag C&.
wheel Q**-
shift+left uiag
Q**- (if you uo not have a mouse wheel oi if you want smooth
zoom)
ctil+shift+left
uiag
%0O$/ iotate, to inteiactively change the uefault light setting.
left uouble click
+"./"M &.N R**- on clickeu point; subsequent iotations anu
zooms will be centeieu on the chosen point.
alt+left uiag
Q /M&.#S&/"; moves the cameia along the viewing uiiection, (the
effect can be similai to zoom, but it allows to moie piecisely
navigate in the space aiounu the object)
shift+wheel
+$&.O" T0"SN *T U0"P anu move the cameia to keep the mouel of
appioximately the same uimension (in piactice
incieaseueciease the peispective uefoimation, much alike the
Bitchcock zoom uepicteu in the veitigo movie).
ctil+wheel
-*U" ."&M VS&." back anu foith to section the object anu
ieveal its inteiioi.
alt+wheel
+$&.O" V*0./ #0R" when ienueiing moue is Points. 0se Points
ienueiing to uisplay inteiactively huge meshes.
4

0thei useful key combinations foi mesh inspecting aie:
+/MSWN toggle uouble siueu lighting
+/MSWX toggle backface culling
+/MSWT toggle blue-ieu back=fiont lighting

0bviously foi mac useis, you shoulu substitute the ctil with the commanu key.
=$.1 82, 8D .1, .H8 #,+,%.$82 .88+ ,2"N+,C Click = click left button of the mouse

click
<"S"+/ all the faces in the uiiection (incluuing the hiuuen
ones behinu)
ctil+click 1NN faces to selection
shift+click ;"-*U" faces to selection
alt+click
<"S"+/ only the fiont faces (without the hiuuen ones
behinu)
ctil+alt+click
1NN only the fiont faces (without the hiuuen ones
behinu) to selection
shift+alt+click
;"-*U" only the fiont faces (without the hiuuen ones
behinu) to selection
wheel Q**-
miuule mouse button 6M&.#S&/" mesh
alt+ miuule mouse
button
;*/&/" mesh

2./"M&+/0U" "N0/0.O /**S#

You can access to these tools by activating them fiom the ,C$. menu oi fiom the
toolbai (all the buttons on the iight). 0nly one of these tools can be activateu at a
time. When you have an active euiting tools all the othei tools aie uisableu.
Activating one of these tools usually changes the way you inteiact with the mesh:
mouse actions aie uiiectly piocesseu by the chosen tool. Foi example when you
stait to use the Painting Tool, youi mouse uiags aie inteipieteu as biush stiokes
ovei the mesh. Remembei that you can toggle back anu foith between the
stanuaiu %"),/" moving mouse moue anu the cuiient tool moue by piessing esc.
Switching to cameia moue uoes not uisable the tool. To exit fiom the euiting
moue piess again the same tool button. You can see that you have completely
closeu an euiting moue by seeing again as active all the othei euiting buttons.

CS&." <S0+0.O 6**S

The 5N0/0.O CS&." <S0+0.O /**S allows useis to cieate one oi moie mesh's slices
obtaineu thiough the inteisection of a set of paiallels plans with the mesh. The
semi-tianspaient plans aie painteu in the main winuows, centeis to the object's
bounuing box that we aie mouifying, with simplicity useis can founu the exactly
position of the plans thiough the geometiy; the euiting of the plans aie not
bounu to the iest of the scene.
S

(Pictuie 1.) Euiting uialog


The tool incluue a uialog (Pictuie 1) with the function:
Y Befine the numbei of plans.
B Restoie the uefault settings.
A Incieaseueciease uistance with a sliue oi euiting manually.
Z Singlemulti file uefine the expoiting moue
o <0OS" @0S" !*N" Single file uispose the iesult of the inteisections
ovei a single Svu file, in a continuous stiip, each item uesigneu
insiue of a iectangle.
o !,S/0 @0S" !*N" Each item has its file, the x-th slice nameu
namefile_X.svg has a single slice.
D Stait with expoiting function.
The inteisection iesult coulu be expoiteu in Scalable vectoi uiaphics (Svu),
theie aie two possible moues:
<0.OS" T0S"#, if the plans aie moie than one all the iesult aie stoieu in a
single file.
!,S/0 T0S"#, foi each plans aie cieateu a file.

(Pictuie 2.) Svu piopeities uialog.


6
The uialog in (pictuie 2) contains the main piopeities of the Svu uocument:
Y Bimensions in centimeteispixels of the global context
B A uinamic set of label that calculate each uimension's item, paiticulaily
useful in multifile expoiting.
A Enableuisable uetails anu text insiue the context.
Z Resolution of the global context in pixels.

1S0O.-"./

Alignment is a iathei complicate piocess. Fiist of all you shoulu have well
unueistoou the layeis mechanism in NeshLab anu the fact that each mesh can
have a tiansfoimation matiix. The alignment piocess simply mouifies the
tiansfoimation of each layei. The main iuea is that you iteiatively glue youi
misaligneu meshes ovei those alieauy aligneu. A mesh that is aligneu togethei
with a set alieauy aligneu mesh is saiu to be 0+:,C anu a * is shown neai to its
name. Initially all meshes aie unglueu. You task is to ioughly align all youi
meshes. 0nce the meshes aie glueu in a iathei goou initial position you can stait
the alignment piocess: the system chooses what meshes have some oveilapping
pait anu foi each paii of meshes the system staits a ICP alignment algoiithm that
piecisely aligns the chosen paii. At the enu of the piocess all the glueu meshes
will hopefully be aligneu togethei.

Key Concepts:
ICP: Iteiateu closeu point: The basic algoiithm that automatically
piecisely aligns a moving mesh N with a fixeu one F. The main iuea is that
we choose a set of (well uistiibuteu) points ovei N anu we seaich on F the
coiiesponuing neaiest points. These paiis aie useu to finu the best iigiu
tiansfoimation that biing the points of N onto the coiiesponuing points
on F. ICP has a lot of tunable paiameteis.
ulobal Alignment: also known as multiview iegistiation. A final step that
evenly uistiibutes the alignment eiioi among all the alignments in oiuei
to avoiu the biaseu accumulation of eiioi.
Absolute Scale. The paiameteis of the alignment tool aie in &'#*S,/"
units, anu the uefaults aie acceptable foi a stanuaiu scannei outputting
meshes in millimetei units. So foi example the taiget eiioi (i.e. the eiioi
that the ICP tiy to achieve) is u.uS mm something that can be achieveu
with a goou scannei. 0bviously if youi iange maps aie in a uiffeient unit
(micions, kilometeis, etc.) you must aujust the uefault alignment
paiameteis oi the alignment piocess will fail.

<-&SS 6,/*M0&S
1. 0pen all the meshes pioviueu in the SampleRangeNaps package, by
simply selecting all the mesh in the open uialog (use ctil foi multiple
selection as stanuaiu). All the meshes will be loaueu togethei in uiffeient
layeis.
2. Stait the alignment tools (the ? in the toolbai)
S. Choose a mesh anu glue in its cuiient position (a stai will appeai besiue
its name).
7
4. Choose anothei mesh (not glueu) anu glue it in the coiiect position by
staiting the *8$2. N"#,C "+$02),2.. A new winuow will popup anu you
have to choose foui coiiesponuing paii of points on the two meshes (the
set of the alieauy glueu one anu the new unglueu mesh). You choose
points by uouble clicking ovei the two meshes.
S. Repeat step 4 until all the meshes have been glueu.
6. Click on "Stait piocess." Now the system will seaich foi oveilapping
meshes anu foi all the meshes that have some oveilaps compute a fine
ICP. At the enu of this piocess a "ulobal Alignment" step will uistiibute
iesiuual eiioi evenly.
7. Now the alignment is complete anu you can look at iesults anu check foi
any eiiois in the alignment piocess.
8. Close the Align Tool.
9. Flatten all the layeis into a single mesh.
1u. Stait the meige piocess by using a suiface ieconstiuction algoiithm like
the Poisson baseu one.
11. Save to a new file.

The euiting >,&S0/[ !&VV0.O 6**S is a tool foi the fine tuning of how scalai
values, uefineu ovei a mesh, aie mappeu into colois. Note that this filtei will not
woik if quality values aie not uefineu ovei the mesh veitexes. The tool is
composeu by two main section:

6M&.#T"M @,.+/0*.

The Tiansfei Function maps, thiough a lineai chait, the uistiibution of the values
of RuB channels ovei a lineai space, iuentifieu by a coloi banu. The tiansfei
function view is inteiactive, in fact the usei can mouify the uistiibution of the
channels values using hanules, that can be auueu, moveu oi iemoveu. To auu a
new hanule to the Tiansfei function, it's necessaiy fiist to select the channel foi
the hanule (by selecting the foiwaiu channel in the top-iight iauio button gioup,
oi by clicking on an hanule of the same channel), anu then uouble-clicking in an
empty place of the tiansfei function view. It's possible to iemove an existing
hanule by uouble-clicking ovei it. Eveiy time a change is peifoimeu to the
tiansfei function, it's immeuiately visible in the coloi banu below. Noie ovei, it's
possible to save the cuiient tiansfei function in a CSv file oi loau it. Impoitant
Note: When a tiansfei function is loaueu fiom an exteinal file the changes to the
cuiient tiansfei function will be lost.

5\,&S0R"M

It iepiesents, thiough an histogiam chait, the uistiibution of the quality ovei the
mesh (x-axis iepiesents quality levels, y-axis iepiesents the numbei of veitexes
with a ceitain quality). Like the tiansfei function view, the histogiam one too is
pioviueu of hanules, exactly thiee. Each hanule has a uiffeient meaning: the
leftmost one, iepiesents the minimum quality limit, the iightmost one the
maximum quality limit, anu the miuule one iepiesents the position of the miuule
quality level iespect to the minimum anu the maximum actual values. The
poition of histogiam uelimiteu by lateial hanules is mappeu in the tiansfei
8
function (visible as backgiounu of the TF view). So, all the quality levels incluueu
in the iange between the histogiam beginning anu the left hanule position will
be mappeu with the leftmost coloi of the coloi banu, while the ones between the
iight hanule anu the histogiam enu will be mappeu with the iightmost coloi. All
the othei values of the histogiam aie mappeu in the coloi banu uepenuing by the
ielative position of the miuule quality value. This value is the paiametei of the
exponential (oi logaiithmic) function useu to inteipolate the TF noues when
mapping quality levels on coloi banu. The cuive iepiesenting this function is
vieweu in the gamma coiiection panel. If a lateial hanule is moveu outsiue the
histogiam, oi if the usei sets in a "lateial" spin box a quality value gieatei than
max oi lessei the min, the histogiam will auto stietch itself. Finally a sliuei can
be useu to change the biightness of the coloi banu colois.

6,/*M0&S#

</M"##0.O /$" +,MU&/,M" *T & -"#$
1. Apply the filtei Coloiizeuaussian Cuivatuie (equalizeu)
2. 0pen the Quality Napping Tool
S. Choose the RuB coloi pieset
4. Quality values ovei uamma Cuivatuie aie often concentiateu in a tight
iange between -" anu +N. So manually set miuule quality to u. Tiy setting
minimum anu maximum equalizei values to stietch the significant pait of
the histogiam all ovei the coloi banu, so that negative values will be
coloieu in ieu anu positive ones will be coloieu in blue, while quality
values aiounu u will be coloieu in gieen
S. You can even mouify the tiansfei function to eliminate the gieen coloi
anu extenu ieu anu blue to all the coloi banu

30U0.O & /*." /* & -"#$
1. Apply the filtei ColoiizeAmbient 0cclusion
2. 0pen the Quality Napping Tool
S. Choose a coloi pieset (i.e. Reu Scale)
4. Nouify the tiansfei function to obtain the coloi scale you like
S. Set the minimummiuulemaximum quality value in equalizei to aujust
the tone uepenuing on the uistiibution of quality ovei the mouel

1VVS[0.O /$" #&-" -&VV0.O /* #"U"M&S -"#$"#
1. Set the Quality Napping tool with significant values
2. Save pieset to a file (it will contain tiansfei function anu equalizei
paiameteis) anu close the tool
S. 0pen a new mesh
4. 0pen Quality Napping tool
S. Click on loau pieset,locate the CSv file you pieviously saveu anu apply the
filtei.

Alteinatively open the filtei Quality Nappei Appliei, locate CSv file anu apply the
filtei. This filtei can be useu also in Neshlab commanu line. Note: all the files
shoulu have similai quality values to be coloieu in a significant way(i.e. applying
the same coloiize filtei)
9

</M&0O$/"."M

The 5N0/0.O </M&0O$/"."M 6**S is a tool foi inteiactively change the
tiansfoimation matiix associateu with eveiy loaueu mesh.

!"#$% This tool is .*/ intenueu foi geneiic tiansfoimations like scaling, sheaiing
oi miiioiing. Such non-iepositioning tiansfoimations can be achieveu using the
"Apply Tiansfoim" filtei.

@"&/,M"#
This tool offeis seveial ways to change mesh alignment anu oiigin:
Buttons foi flipping on, swapping between anu iotating aiounu all the
piimaiy axes.
A button to align the axes with the cuiient view.
Buttons anu sliueis to put the cooiuinate oiigin in any point insiue the
mesh bounuing box.
A button to put the cooiuinate oiigin in the tiackball centei.
Inteiactive "fieehanu" moues:
o 0sei can uiag the mesh wit the cooiuinate fiame.
o 0sei can uiag the cooiuinate fiame wit the mesh, using a special
euleiian tiackball, also able to make angle-constiaineu iotations.
Ways to liteially "uiaw" one oi two axis uiiection uiiectly on the mesh.
Ways to align the cooiuinate fiame on the best fitting plane of the
eventually selecteu veitexes in the mesh.
A button to fieeze the cuiient tiansfoimation in the mesh.

The tool also offeis an integiateu unuo system anu contiol ovei seveial visual
feeubacks.

<&-VS" 9#&O"
Beie we show, thiough examples, seveial ways to use this tool:

K&#0+#
0pen the file "sciewuiivei.ply" in the "sample" uiiectoiy.
This mesh's uefault oiientation is such that if the view tiackball isn't iotateu, the
mesh itself is haiuly iecognizable.
Click on the "Stiaighten up a mesh" button.
Now the tool usei inteiface is shown, anu uiagging the mouse on the mesh will
have no effect.
Click on the Swap Z with X button, then on the Rotate 9u uegiees aiounu
X button
Now the mesh tiansfoimation matiix has been changeu, but the mesh has not
been mouifieu.
Click on the fieeze button
Now the mesh has been upuateu, anu the new oiientation can be saveu.
Like eveiy othei euiting tool, Stiaightenei can be suspenueu using the "Not
euiting" button, anu the view tiackball can be mouifieu.

1u
<0-VS" </M&0O$/".0.O
0pen the file "sub.obj" in the "sample" uiiectoiy anu stait the tool.
This mesh's uefault oiientation is plain wiong, this can be easily seen fiom the
visual feeuback.
Suspenu the tool (esc) anu iotate the view tiackball until the submaiine
siue is coiiectly vieweu.
Resume the tool (esc again) anu click on the "align with actual view"
button, then click on centei on bbox button (in the oiigin tab).
Now the mesh is coiiectly oiientateu, anu can be fieezeu.
The cooiuinate fiame oiientation anu position can be iefineu, toggling the
"Fieehanu mesh uiagging" button:
Left click iotates aiounu the cuiient axis
Right click tianlsates along the cuiient axis
The uefault cuiient axis is x, it can be changeu to y anu z using the ctil anu
shift keyboaiu mouifieis (visual feeuback is pioviueu foi ease of use).
Rotation can be uone in a contiolleu fashion setting the snap value.
The new cooiuinate fiame can be accepteu toggling the "Fieehanu mesh
uiagging" button again.

%&["M E*-V*#0/0*.
This tool can be useu to compose multiple layeis.
0pen the file "twiil.off" in the "sample" uiiectoiy anu stait the tool.
Click on the "flip y anu z" button, fieeze anu close the tool.
"0pen insiue" the mesh the file "shaip spheie" anu iestait the tool.
Note that the tool woiks always in the layei active H1,2 .1, .88+ #."/.,C.
Click on the iotate 9u aiounu z button, then toggle "Fieehanu mesh
uiagging" (in the Biag tab). A blue wiiefiame shaip spheie is now
ienueieu ovei the oiiginal one, that can be uiaggeu like the view tiackball
(without scaling, of couise).
Ctil-uiag the wiiefiame spheie to pan it up the top of the twiil. Again, the
tool can be suspenueu anu the view changeu uuiing all these opeiation, if
necessaiy.
Toggle back the "Fieehanu mesh uiagging" button to accept the new
spheie position, then fieeze anu close the tool.

Now the composeu layeis can be meigeuflatteneu uown to a pawn-iesembling
mesh.

<V"+0&S @"&/,M"#
This tool has also two families of special featuies, useful if the mesh is not
stiaight anu not iegulai, but has some iegulai suifaces that can be taken as
iefeience (e.g. the basement of a scanneu statue).
The fiist family is the "uiaw axes on mesh" one: using one oi two "iubbeibanus"
(similiai to the Neasuiing Tool one) the usei can uiaw a segment oi two on the
mesh suiface, anu the cooiuinate system will iotate aiounu its oiigin to align the
chosen fiist axis to the fiist uiawn segment. Then, if anothei axis has been
uiawn, the cooiuinate fiame will iotate "/8:2C .1, D$/#. "P$# to align the seconu
one as much as possible.
11
The seconu family is the "get fiom selection", anu is available only if some
veitexes aie selecteu (obviously). Fiom the selection a best fitting plane is
computeu, then the chosen cooiuinate fiame plane is aligneu with the computeu
one, anu the oiigin is put on the plane piojection of the selection bounuing box
centei

C*0./ C0+X0.O 6**S

)"#+M0V/0*.
This tool can basically be uesciibeu as a mesh labeling tool. It allows you to pick
anu name points on a mesh anu save the output to xml.

&$'$()*
The tool has two main moues, noimal anu template moue. Template moue is
uesciibeu below. Theie aie two main moues of inteiaction with the points, C0+X
C*0./, !*U" C*0./, anu <"S"+/ C*0./ moue. The moue of inteiaction is inuicateu
by the iauio at the top. In pick moue you auu new points to the mesh by iight
clicking on the mesh. In move moue you can move a point by iight clicking neai
the point anu uiagging it to a uiffeient location. In select moue you can iight click
a point on the mesh anu it will be highlighteu in the pick points euit tool menu.

Beie aie some notes about the &+/0U" checkbox. The immeuiate affect of
checking the active checkbox is to hiueshow the pickeu point on the mesh. This
featuie is meant to allow to use a template foi which scan uata will have one of
the template points missing. In this case you can unflag this point, labeling it in-
active. When points aie auueu you have a gieen cone, iepiesenting the noimal,
with a label next to it. You can also choose at the bottom wheie it says 4*M-&S
:V/0*.# to have just a uot, which is the point, a label foi that point, oi a uot,
label, anu a gieen line which iepiesents the noimal of the face the point is on.

,$-.*)#$ /"0$
Summaiy: Templates aie use to facilitate the labeling of many meshes with the
same labels. If you have a template loaueu you aie in Template Noue. The name
of the template will be wiitten in blue letteis next to the place at the bottom
wheie it says "Template Name:". "No Template Loaueu" will be piinteu if no
template is loaueu.

In Template moue you will only be able to pick anu move the points that aie
alieauy uefineu as pait of the template. 0se the 1NN C*0./ anu ;"-*U" C*0./
buttons in the Template Contiols aiea to mouify a template. You can also stait
fiom sciatch, pick some points, then save them as a template (saving the names
so you can use them foi othei meshes).

1)23'456")03'4 7"3'#8
Points aie saveu to & ]-S T0S" by using the #&U" ',//*. at the top. Points can be
loaueu fiom a file by piessing the loau button. Alteinately points aie
&,/*-&/0+&SS[ S*&N"N TM*- & T0S" if you hau pieviously saveu them using the
filename iecommenueu by the tool.
12
Points aie #&U"N /* C"M!"#$1//M0',/"# automatically when you close the euit
plugin anu loaueu back fiom PeiNeshAttiibute when the plugin is loaueu. This
takes pieceuent ovei loauing points fiom a file.

9#:$( ;$)#<($8
1. Rename a point by slowly uouble clicking on it
2. 0nuo: will unuo only that last move

9#" G0/$ ^1S0O. !"#$ ,#0.O C0+X"N C*0./#^ T0S/"M

In oiuei to use the 1S0O. !"#$ ,#0.O C0+X"N C*0./# filtei you neeu to have
eithei saveu points:
1. to PeiNeshAttiibutes oi
2. to a file with the name suggesteu by the point picking plugin.

Note: that points aie only neeueu if "0se Naikeis foi Alignment" is checkeu.
Note: that if "Scale the mesh" is checkeu then you neeu points anu to have
checkeu "0se Naikeis foi Alignment".
Note: the tiansfoim calculateu is stoieu in pei mesh uata with key
AlignTools::getKey()

4*/"# T*M )"U"S*V"M# P$* P&./ /* ,#" V0+X"N V*0./# 0. /$"0M VS,O0.

You can look at how the filtei FP_ALIuN_WITB_PICKEB_P0INTS in the cleanfiltei
plugin uses points pickeu by the euit_pickpoints plugin. Note, most coue is heie,
cleanfilteicleanfiltei.cpp but the impoitant bit is heie:
NeshNouel *stuckNouel = pai.getNesh(StuckNesh); PickeuPoints
*stuckPickeuPoints = u; ... fiist tiy to get points fiom memoiy
if(vcg::tii::BasPeiNeshAttiibute(stuckNouel->cm, PickeuPoints::Key) ) {
CNesh0::PeiNeshAttiibuteBanule<PickeuPoints*> ppBanule =
vcg::tii::Allocatoi<CNesh0>::uetPeiNeshAttiibute<PickeuPoints*>(stu
ckNouel->cm, PickeuPoints::Key); stuckPickeuPoints = ppBanule();

What you get is a PickeuPoints object. To see what it uoes look heie
meshlabpluginseuit_pickpointspickeuPoints.h(cpp).

Basically what you neeu to know is that this class holu a
stu::vectoi<PickeuPoint*> wheie a PickeuPoint is a simple object that has two
membeis:
1. name of point: QStiing name;
2. point: vcg::PointSf point;


:/$"M 0.T*M-&/0*.
souice coue in euit_pickpoints foluei




1S
?*S" @0SS"M 6**S

The Inteiactive Bole Fillei Tool is a tool allow the usei select holes anu euit them
in uiffeient ways. The goal featuie of this plugin is fill holes as usei want, but to
uo this it's also possible euit hole's topology.

CM"M"\,0#0/0"#
Bole Fillei Tool neeu meshes manifoluness.

?*S" <"S"+/0*._
0sei can select an hole to euit with a mouse click ovei a boiuei face oi pinning
the checkbox in uialog.

?*S" @0SS0.O_
Basic filling algoiithm use a tecnique wich auus a face between two aujacent
boiuei euge (fiienuly calleu "eai"). This is a gieeuy algoiithm which choose each
time the best paii of aujacent boiuei euge into the hole. Bowevei selecteu holes
can be filleu follow uiffeient ciiteiia:
Q/$G$"+: best eai is computeu only with face (tiiangle) quality
@$2$):)=,$01.: best eai is computeu mixing quality face anu angle
beetween eai anu aujacent faces.
(,+D^2.,/#,%.$82: as Ninimumweight but pay attention to
autocompenetiating face.

When holes aie filleu usei can fill again, maybe with uiffeient paiams, oi accept
oi uiscaiu patch applieu by filling. As selection, acceptance coulu be uone
clicking the mesh oi uiiectly into the uialog.

?*S" KM0NO0.O_


Biiuges type
Sometimes iight filling must be uiiven by usei, to uo that it's possible auu some
biiuge, manually oi automatically. Biiuge consist into 2 aujacent face which
connect 2 uiffeient boiuei euge. With biiuge an usei can:
split an hole, if biiuge is builueu with staiting anu final boiuei euge
belong to same hole
unify moie holes into one, if biiuges connect euges belong uiffeient holes.
14

/)'<)* =(3043'4%
0sei select the two euges to connect picking the boiuei face. It cannot builu a
biiuge beetween 2 aujacent euges.

><#"-)#3? @(3043'4%
Automatic biiuing woiks on selecteu holes. 0sei have to specify if he want
connect all selecteu holes oi split each selecteu hole.

4*. !&.0T*SN ?*S" <VS0//0.O_
Filling can manage non manifolu holes, but this plugin allow euit hole stiuctuie
to split an non manifolu hole into many manifolu ones.

)&/& </M,+/,M"#
90.J8+,: Extenu vcg::tii::Bole<NESB>::Info auuing some infoimation like
the hole status (selection, autocompenetiation, filling...). Also auu
functionality to uiaw, fill anu iestoie...
90.!/$C0,!"#,: abstiact class which exposes methou useu by
BoleSetNanagei.
o 90.!/$C0,: biiuges useu to connect 2 boiuei euge. It can split an
hole oi unify 2 (oi moie) holes.
o 90.F@!/$C0,: faces auueu to close non manifolu holes.
J8+,(,.@"2"0,/: it is an unique entity to manage the holes anu the
biiuges existing into the same mesh (so with the same auuitional uata).
J8+,5$#.@8C,+: mouel of mouelview aichitectuie useu by gui.


!&MX 0./"M"#/0.O T&+"#


Flags usage
Inteiactive Bole Fillei tool maik inteiesting faces using auuitional uata. This
maikei, with holes piopeities, aie useu to know topology of holes anu its filling.
Chaiacteiistic face types aie:
J8+,!8/C,/9"%,: maiks faces which have at least an euge aujacent to hole,
boiuei faces oi faces aujacent to hole's filling
J8+,A".%19"%,: maiks faces auueu to fill hole
A".%178)*9"%,: maiks faces self-inteisecting with mesh
!/$C0,9"%,: maiks faces auueu to euit holes

1S
KM0NO"# ',SN0.O 0##,"


Topology of biiuge's face

;4#=(304$
Rappiesent the ieal meaning of woiu biiuge. It connects 2 euge, has 2 abutment
ovei the mesh anu has 2 boiei siue. It is a paii of faces, both aujacent to each
othei. Theie is 2 way to tiiangulate 2 euges (4 veitex) so it'll choose
configuiation with best quality of its face. Biiuge is builu to have euge u aujacent
to mesh foi both its faces, anu its faces shaie euge 1 oi 2 following the
tiiangulate configuiation.

;4#!/=(304$
It's a single face useu to change non-manifolu veitex in manifolu one. It has
veitex u on non manifolu veitex anu euge u anu 2 aujacent mesh. Its euge 1 coulu
be a boiuei euge of anothei hole, but it coulu fill entiiely the sub-hole (if sub hole
has only S biuei euge).

<S0+0.O & -"#$

veision 1.1.1 of NeshLab can uo slicing. It is a bit (!) buggy, anu with a iathei
clumsy inteiface but moie oi less woiks. Next veision will have a cleanei moie
iobust inteiface (hopefully). Slices aie expoiteu in svg foimat. Conveision fiom
2B svg to 2B uxf can be uone by inkscape.

micio tutoiial
1. 0pen a mesh
2. iotate it with the tiansfoimation uialog so that slicing with planes paiallel
to the YZ plane is ok (use the ienuei-> show axis foi checking)
S. stait the slicing tool
16
4. uiagging in the winuow move the slicing plane oiientation, so B0 N0T
uiag ovei the winuow if the yz plane is ok foi you. If you want to examine
the mouel piess the tiackball icon in the tool bai.
S. set the uesiieu numbei of planes
6. piess expoit (you can choose if you want to have all youi slice in single
file oi in multiple files)
7. you can customize a bit the output, by iemoving label, ueciuing the size of
the output.

ES"&.0.O & !"#$

Cleaning a mesh means tiying to iemove all the small geometiical anu
topological inconsistencies that can be founu in off-the shelf meshes. Common
pioblems that usually have to be checkeu aie the following ones:

Buplicateu veitices
0niefeienceu veitices
Null Faces
Self Inteisecting faces
Non Nanifolu faces
Small Boles. Small holes (small in teims of numbei of the euges that
compose theii bounuaiy) can be safely autmatically closeu. Laigei holes
neeus some special caie...
Small uangling aitifacts. It happens that aftei a SB scanning theie aie a lot
of small *$,%,# floating in the aii, unconnecteu with the iest of the suiface.
These pieces aie #)"++ %822,%.,C %8)*82,2.#; you can iemove them with
the apposite filteis, that can uisciiminate accoiuing to the size of the
pieces in teims of faces composing them oi theii spatial uiametei.
Removing Noise. This is a moie complicateu task. This happens usually
when managing SB scanneu meshes. It happens that suiface that you
expect to be peifetly flat aie affecteu by some kinu of noise anu aie
iiiegulai. }ust like foi image piocessing noise iemoval has positive anu
negative siues. NeshLab suppoits uiffeint kinu of smoothing filteis that
aie able to iemove vaiious kinu of noise:
o Laplacian
o BC Laplacian
o Two Step Smoothing
),VS0+&/"N U"M/0+"#
If youi mouel is coming uiiectly fiom a SB scannei, theie will be many
uuplicate uefinitions foi each veitex. If the mouel is manipulateu in
NeshLab anu then expoiteu to anothei softwaie package, these uuplicate
points can cause pioblems with ienueiing anu conveision to uiffeient
foimats. By iemoving these uuplicate veitex uefinitions, the mouel can be
simplifieu anu uownstieam softwaie pioblems ieuuceu.
A small uiscussion on uuplicateu veitices, uniefeienceu veitices anu how
to iemove them with NeshLab can be founu in the NeshLab stuff blog
0pen youi mouel
The message bai at the bottom of the scieen will inuicate the numbei of
faces anu the numbei of veitices in the mouel
17
A uialog will pop up asking if you want to unify uuplicateu veitices. Select
No.
Aftei the mouel loaus, click on the Filteis Tab
Select the Clean submenu.
Select Remove Buplicateu veitex
Aftei peifoiming this cleaning step, theie shoulu be a significant ueciease
in the numbei of veitices associateu with the mouel.

2-&O"`'&#"N A) ;"+*.#/M,+/0*.

!"#$S&', in conjunction with anothei tool calleu [*8%1 L; =,N#,/G$%, is able to
piouuce accuiate SB mouel staiting fiom a set of images of the object to
ieconstiuct. The steps to follow aie:
1. Piocess youi images with the Epoch SB Webseivice
2. Impoit the output of the Epoch SB Webseivice with Neshlab
S. Neige the iange maps anu builu the mouel

!"MO" /$" M&.O" -&V# &.N ',0SN /$" -*N"S

Beie we uesciibe the vaiious paiameteis involveu in the cieation of iange maps
fiom the iaw uata coming out fiom the web ieconstiuction seivice. It is possible
to mouify seveial paiameteis in oiuei to piouuce SB iange maps that aie
cleanei anu affecteu by lowei noise.

Paiameteis uesciiption:
<,'#&-VS"
Inuicates the level of sub-sampling of the iange maps useu.
Example: foi a iange map of 6uux4uu a level of 2 inuicates that you use a
Suux2uu pixels in total foi each iange map. This paiametei is useu to
ieuuce the final numbei of veitices of the mouel. The ieuuction is uone in
a weighteu mannei.
!0.0-,- E*,./
Inuicates the minimum numbei of occuiiences iequiieu foi a value of
uepth to be consiueieu foi the ieconstiuction.
Example: if @$2$):) 78:2. is set to 6 a value of uepth that has no
coiiesponuences in at least 6 iange maps is not useu to builu the mouel.
!0.0-,- 1.OS"
faces that haves theii noimal foiming an angle with view uiiection laigei
than the inuicateu value (in uegiee) aie ueleteu.
;"-*U" C0"+"# S"## /$&.
Aftei the meshing all the uangling pieces composeu by a numbei of faces
smallei than the inuicateu values aie ueleteu. In this way you can
automatically uelete all the small floating pieces that usually aie just
noise.
)"V/$ @0S/"M
The uepth filtei is useu to ieuuce the noise of the estimateu iange maps.
Sometimes coulu happen that the computeu iange maps aie noisy,
especially neai high uepth giauient. With this paiameteis the usei can
contiol a filtei bank (C$+".$82 anu ,/8#$82 filtei) to ieuuce this unuesiieu
18
effect that iesults in geometiic aitifacts on the mouel's suiface. The
uilation filtei is applieu befoie the eiosion one. The uefaults paiameteis
aie goou in most cases. The eiosion ieuuce the ieconstiucteu suiface
aiea, hence to ieconstiuct moie uetail ieuuce the steps oi size of this
filtei. If the iange maps still iemains noisy aftei the filteiing inciease the
eiosion steps oi size. Inciease uilation steps oi size in case of holes in the
ieconstiucteu suifaces.
@&#/ !"MO"
This option active a fast meige piocess but piouuce a less accuiate mouel.
If high accuiacy is not iequiieu oi many iange maps have to be piocesseu
this option shoulu be active.

%&["M#
Since veision 1.1 NeshLab suppoits the management of meshes oiganizeu into
multiple layeis. In simple woius it is possible to have many meshes in the same
winuow. Each mesh is kept on a sepaiate layei anu most of the toolsfilteis aie
uesigneu to opeiate to only one of them at a time (foi example smoothing filteis
smooths out only the cuiient layei). Saving anu loauing aie usually single layei
oiienteu too (e.g. when you save a ply you save just the cuiient layei). As a
ieasonable metaphoi of the layei insiue meshlab you can consiuei how the layei
mechanism woiks in a bitmap euiting application (like gimp).
A set of layei builu up a */8Z,%. that can be saveu a sepaiate entity (in the simple
ALN ascii foimat).
Each layei stoies also a 4x4 tiansfoimation matiix. This tiansfoimation matiix is
useu mostly foi ienueiing anu has a leauing iole in the ||alignmentj piocess
wheie it coues the ielative tiansfoimation between the vaiious iange maps. All
the piocessing filteis noimally woiks in the 2".:/"+ space of the mesh, with the
plain exception of filteis specifically uesigneu to woik with these tiansfoimation,
like the ./"2#D8/)".$82 filtei anu the D/,,_, filtei that make this tiansfoimation
peipetual actually changing the cooiuinates of the mesh veitexes.

To have multiple active layeis you can alteinatively:
select moie than a single file in the open uialog anu piess ok.
open a mesh anu then use the 'open as a new layei' commanu in the file
menu
open a mesh, show the layei uialog (button on the toolbai) anu piess the
"+" button.
You can meige uiffeient layeis togethei by means of the 'flatten' commanu. The
flattening opeiation simply put the mesh togethei in the same layeis fieezing
theii cooiuinates.

%&["M !&.&O-"./

Neshlabs has a poweiful Layei Nanagment Tools. It is similai to othei softwaies
like Auobe Photoshop, The uimp, etc. To manage uiffeient layeis, piess the Sth
button in the task bai (some giay planes). A tab opens at the left siue. Beie you
see all youi layeis.

19
!, %"/,D:+` H1,2 68: 8*,2 " 2,H ),#1` .1, +"6,/# N8P /,)"$2# :2%1"20,C V 68:
1"G, .8 8*,2 $. "0"$2 .8 1"G, .1, %8//,%. +"6,/#&

!&.&O0.O /$" %&["M#
You can auu an exteinal mesh to a new layei by going in File > 0pen As New
Layei. To manage the layeis, you can eithei iight-click on the layei box, oi go in
Filteis > Layeis Nanagement.

Then you have S options :
1. Automatic Paii Alignment -> .
2. Fieeze Cuiient Natiix -> .
S. Nove Selection to anothei Layei -> Cieate a new layei with the selecteu
faces. Select some faces on youi mouel, then choose "Nove selection to
anothei layei". You have a veiy explicit option "Belete oiiginal selection" :
you eithei )8G, oi C:*+$%"., youi selection on the new layei.
4. Buplicate Layei -> Cieate a new layei with the same mesh as the selecteu
layei. The uiffeience with the option above is that it copys "++ the mesh,
not only the selecteu faces.
S. Flatten visible Layeis -> You can meigeu uiffeient visible layeis. The
options aie again explicit.

2./"M&+/0.O P0/$ /$" S&["M#
You can woik with only one layei at each moment, the one which is selecteu in
yellow. This incluues saving (abc*.S[ /$" #"S"+/"N S&["M# 0# #&U"Nabc),
selection, anu moie globally all inteiactions. To choose the layei with whom you
want to woik, simply left click on it in the layei box. You can also hiue oi piint
each layei with the small "eye" icon.

Q$* : Something veiy poweiful is that you can select faces on a layei, then hiue it
(this layeis being still selecteu). Boing so allows you to see the selecteu faces in
ieu, but tianspaient - it is quite useful to compaie meshes, by example.

6M&.#T*M-0.O & !"#$
To tiansfoim a Nesh (tianslation, iotation, scale), go in Filteis > Noimals,
Cuivatuie anu 0iientation > Apply Tiansfoim. Theie you have S tabs which
allows you to tianslate, iotate anu scale youi mesh.

Q$* : Think to show the axis (Renuei > Show Axis), it ieally helps :)

When you change the paiameteis, you can eithei choose : -Absolute option :
cleai the pievious tiansfoimation anu apply only the cuiient set -Relative
option : incluue the cuiient set to the pievious tiansfoimation. Foi each
tiansfoimation piess "Apply" to see what happens.

6M&.#S&/0*. veiy simple to use, you can set a uiiection in X, Y oi Z. The axis
helps you to know the uiiection. The length values aie not absolute : if you apply
a tiansfoimation, the length unit can change. 0seful option @8G, 7,2.,/ Q8 I/$0$2
2u
<+&S" veiy simple to use too, you can change the scale in X, Y, oi Z. 0seful option
<2$D8/) to set the same scale in the S uiiections. Be caieful : if you combine this
option with iotation, the iesults might be suipiising sometimes.

;*/&/0*.The most uifficult option. You can set a iotation aiounu an axe (X,Y, Z)
in uegiees. The axis helps you too to know the uiiection. You have 2 options :
tuin aiounu the centei of the mesh (centei of giavity .) anu tuin aiounu the
oiigin. But theie is a tiap (:p) : .1, 8/$0$2 $# 28. +8%".,C $2 .1, $2.,/#,%.$82 8D .1,
"P$# a It is locateu on the oiigin of the mesh, cooiuinates (u,u,u), which is uiffeient
of the oiigin of the shown axis. When you aie satisfieu with youi tiansfoimation,
piess "Close anu Fieeze". Waining : you cannot unuo it ! Anu you lost the
tiansfoimation matiix associateu, so think to copy it befoie if you neeu it !
"Close" cancels eveiything.

Q$* : if you have stiange behaviois with iotation oi scale, close anu fieeze the
tiansfoim, then open the filteis again. You may be in extieme values, close to the
piecision levels.

@0S/"M#

The Filtei List page piesents a simple long list of all the filteis that will be
available on the 1.2. veision.
Simplification
Neshing
Align Nesh using Pickeu Points
Noiph Nesh
NLS Suifaces
Convex BullAlpha Shapevoionoi Reconstiuction filtei

@0S/"M %0#/ Y7B7L
>43'4 13-<*)#3"' Simulates the aging effects uue to small collisions oi
vaiious chipping events
A$(#$B >-@3$'# 9??*<83"' ueneiates enviionment occlusions values foi
the loaueu mesh
;)?$ >-@3$'# 9??*<83"' ueneiates enviionment occlusions values foi
the loaueu mesh
><#"-)#3? .)3( >*34'-$'# Automatic Rough Alignment of two meshes.
Baseu on the papei Z`C*0./# E*.OM,"./ <"/# T*M ;*',#/ C&0MP0#"
<,MT&+" ;"O0#/M&/0*., by Aigei,Nitia, Cohen-0i. Siggiaph 2uu8
=)** 732"#3'4 1<(C)?$ D$?"'8#(<?#3"' Reconstiuct a suiface using the
K&SS C0U*/0.O 1SO*M0/$- (Beinaiuini et al. 1999). Staiting with a seeu
tiiangle, the BPA algoiithm pivots a ball aiounu an euge (i.e. it ievolves
aiounu the euge while keeping in contact with the euge enupoints) until it
touches anothei point, foiming anothei tiiangle. The piocess continues
until all ieachable euges have been tiieu.
D$-"2$ 2$(#3?$8 E(# F<)*3#G Remove all the veitices with a quality lowei
smallei than the specifieu constant
D$-"2$ 38"*)#$0 .3$?$8 HE(# C)?$ '<-I Remove isolateu connecteu
components composeu by a limiteu numbei of tiiangles
21
D$-"2$ 38"*)#$0 .3$?$8 HE(# 03)-$#$(I Remove isolateu connecteu
components whose uiametei is smallei than the specifieu constant
>*34' /$8: <83'4 73?J$0 7"3'#8 Align this mesh with anothei that has
coiiesponuing pickeu points.
1$*$?# ;)?$8 @G 23$E )'4*$ Select faces accoiuing to the angle between
theii noimal anu the view uiiection. It is useu in iange map piocessing to
select anu uelete steep faces paiallel to viewuiiection
D$-"2$ ,KA$(#3?$8 @G $04$ C*3. Removes t-veitices by flipping the
opposite euge on the uegeneiate face if the tiiangulation quality impioves
D$-"2$ ,KA$(#3?$8 @G $04$ ?"**).8$ Removes t-veitices fiom the mesh
by collapsing the shoitest of the inciuent euges
D$-"2$ L<.*3?)#$ ;)?$8 Remove all the uuplicate faces. Two faces aie
consiueieu equal if they aie composeu by the same set of veiticies,
iegaiuless of the oiuei of the veitices.
/$(4$ M*"8$ A$(#3?$8 Neige toghetei all the veitices that aie neaiei than
the speicifieu thiesholu. Like a unify uuplicateu veitices but with some
toleiance.
M"*"(3N$ @G O<)*3#G Coloiize veitex anu faces uepenuing on quality fielu
(manually equalizeu).
L38?($#$ M<(2)#<($8 Coloiize accoiuing to vaiious uisciete cuivatuie
computeu as uesciibeu in: ';$#%/,., ;$DD,/,2.$"+VU,8),./6 I*,/".8/# D8/
Q/$"20:+".,C EV@"2$D8+C#' N. Neyei, N. Besbiun, P. Schiouei, A. B. Baii
,(3)'4*$ F<)*3#G Coloiize faces uepenuing on tiiangle quality:
1: minimum iatio heighteuge among the euges
2: iatio between iauii of incentei anu ciicumcentei
S: 2*sqit(a, b)(a+b), a, b the eigenvalues of N^tN, N tiansfoim tiiangle
into equilateial
1$*C P'#$(8$?#3'4 ;)?$8 Select only self inteisecting faces.
1$*C P'#$(8$?#3"'8 Coloiize only self inteisecting faces.
="(0$( Coloiize only boiuei euges.
,$B#<($ ="(0$( Coloiize only boiuei euges.
M"*"( '"' /)'3C"*0 ;)?$8 Coloiize the non manifolu euges, eg the euges
wheie theie aie moie than two inciuent faces
M"*"( '"' /)'3C"*0 A$(#3?$8 Coloiize only non manifolu euges eg.
6).*)?3)' 1-""#: A$(#$B M"*"( Laplacian Smooth veitex Coloi
6).*)?3)' 1-""#: ;)?$ M"*"( Laplacian Smooth Face Coloi
A$(#$B #" ;)?$ ?"*"( #()'8C$( veitex to Face coloi tiansfei
;)?$ #" A$(#$B ?"*"( #()'8C$( Face to veitex coloi tiansfei
,$B#<($ #" A$(#$B ?"*"( #()'8C$( Textuie to veitex coloi tiansfei
D)'0"- ;)?$ M"*"( Coloiize Faces ianuomly. If inteinal euges aie
piesent they aie useu
A$(#$B M"*"( ;3**3'4 Fills the coloi of the veitexes of the mesh with a coloi
chooseu by the usei.
A$(#$B M"*"( P'2$(# Inveits the colois of the veitexes of the mesh.
A$(#$B M"*"( ,:($8:"*03'4 Reuuces the coloi the veitexes of the mesh to
two colois accoiuing to a thiesholu.
A$(#$B M"*"( =(34:#'$88 Change the coloi the veitexes of the mesh
aujusting the oveiall biightness of the mesh.
22
A$(#$B M"*"( M"'#()8# Change the coloi the veitexes of the mesh
aujusting the contiast of the mesh.
A$(#$B M"*"( M"'#()8# )'0 =(34:#'$88 Change the coloi the veitexes of
the mesh aujusting both biightness anu contiast of the mesh.
A$(#$B M"*"( &)--) M"(($?#3"' Pioviues stanuaiu gamma coiiection
foi aujusting the coloi the veitexes of the mesh.
A$(#$B M"*"( 6$2$*8 >0Q<8#-$'# The filtei allows aujustment of coloi
levels. It is a custom way to map an inteival of coloi into anothei one. The
usei can set the input minimum anu maximum levels, gamma anu the
output minimum anu maximum levels (many tools call them iespectively
input black point, white point, giay point, output black point anu white
point).
A$(#$B M"*"( M"*"<(38)#3"' Allows the application of a coloi to the mesh.
In spite of the Fill opeiation, the coloi is blenueu with the mesh accoiuing
to a given intensity. .
A$(#$B M"*"( L$8)#<()#3"' The filtei uesatuiates the colois of the mesh.
This pioviues a simple way to conveit a mesh in giay tones. The usei can
choose the uesatuiation methou to apply; they aie baseu on Lightness,
Luminosity anu Aveiage.
RF<)*3N$ A$(#$B M"*"( The filtei equalizes the colois histogiam. It is a
kinu of automatic iegulation of contiast; the colois histogiam is expanueu
to fit all the iange of colois.
A$(#$B M"*"( S:3#$ =)*)'?$ The filtei pioviues a stanuaiu white balance
tiansfoimation. It is uone coiiecting the RuB channels with a factoi such
that, the biightei coloi in the mesh, that is supposeu to be white, becomes
ieally white.
="B Cieate a Box
1.:$($ Cieate a Spheie
P?"8):$0("' Cieate an Icosaheuion
L"0$?):$0("' Cieate an Bouecaheuion
,$#():$0("' Cieate a Tetiaheuion
9?#):$0("' Cieate an 0ctaheuion
M"'$ Cieate a Cone
M"'03#3"')* A$(#$B 1$*$?#3"' Boolean function using mupaisei lib to
peifoim veitex selection ovei cuiient mesh. It's possible to use
paienthesis, pei-veitex vaiiables anu boolean opeiatoi:
d,e,&.N,*M,fg,h
It's possible to use the following pei-veitex vaiiables in the expiession:
x, y, z, nx, ny, nz (noimal), i, g, b (coloi), q (quality), iau, vi,
anu all custom G,/.,P "../$N:.,# alieauy uefineu by usei.
M"'03#3"')* ;)?$ 1$*$?#3"' Boolean function using mupaisei lib to
peifoim faces selection ovei cuiient mesh.
It's possible to use paienthesis, pei-veitex vaiiables anu boolean
opeiatoi:
d,e,&.N,*M,fg,h
It's possible to use pei-face vaiiables like attiibutes associateu to the
thiee veitex of eveiy face.
]Li[LiRL foi T0M#/ U"M/"]; x1,y1,z1 foi seconu veitex; x2,y2,z2 foi thiiu
veitex.
2S
anu also .]Li.[Li.RL nx1,ny1,nz1 etc. foi .*M-&S# anu MLiOLi'L foi
+*S*M,\Li\Yi\B foi \,&S0/[.
&$"-$#(3? ;<'?#3"' ueometiic function using mupaisei lib to geneiate
new CooiuYou can change x,y,z foi eveiy veitex accoiuing to the function
specifieu.It's possible to use the following pei-veitex vaiiables in the
expiession:x, y, z, nx, ny, nz (noimal), i, g, b (coloi), q (quality), iau, vi,
anu all custom G,/.,P "../$N:.,# alieauy uefineu by usei.
7$(K;)?$ M"*"( ;<'?#3"' Coloi function using mupaisei lib to geneiate
new RuB coloi foi eveiy face. Inseit thiee function each one foi ieu, gieen
anu blue channel iespectively. It's possible to use pei-face vaiiables like
attiibutes associateu to the thiee veitex of eveiy face.
]Li[LiRL foi T0M#/ U"M/"]; x1,y1,z1 foi seconu veitex; x2,y2,z2 foi thiiu
veitex anu also .]Li.[Li.RL nx1,ny1,nz1 etc. foi .*M-&S# anu MLiOLi'L
foi +*S*M,\Li\Yi\B foi \,&S0/[.
7$(KA$(#$B M"*"( ;<'?#3"' Coloi function using mupaisei lib to geneiate
new RuB coloi foi eveiy veitex. Inseit thiee function each one foi ieu,
gieen anu blue channel iespectively. It's possible to use the following pei-
veitex vaiiables in the expiession: x, y, z, nx, ny, nz (noimal), i, g, b
(coloi), q (quality), iau, vi, anu all custom G,/.,P "../$N:.,# alieauy
uefineu by usei.
7$(KA$(#$B O<)*3#G ;<'?#3"' Quality function using mupaisei to geneiate
new Quality foi eveiy veitex. It's possible to use the following pei-veitex
vaiiables in the expiession: x, y, z, nx, ny, nz (noimal), i, g, b (coloi), q
(quality), iau, vi, anu all custom G,/.,P "../$N:.,# alieauy uefineu by usei.
7$(K;)?$ O<)*3#G ;<'?#3"' Quality function using mupaisei to geneiate
new Quality foi eveiy face. Inseit thiee function each one foi quality of
the thiee veitex of a face. It's possible to use pei-face vaiiables like
attiibutes associateu to the thiee veitex of eveiy face.
]Li[LiRL foi T0M#/ U"M/"]; x1,y1,z1 foi seconu veitex; x2,y2,z2 foi thiiu
veitex. anu also .]Li.[Li.RL nx1,ny1,nz1 etc. foi .*M-&S# anu MLiOLi'L
foi +*S*M,\Li\Yi\B foi \,&S0/[.
L$C3'$ !$E 7$(KA$(#$B >##(3@<#$ Auu a new Pei-veitex scalai attiibute
to cuiient mesh anu fill it with the uefineu function.
The name specifieu below can be useu in othei filtei functionIt's possible
to use the following pei-veitex vaiiables in the expiession:
x, y, z, nx, ny, nz (noimal), i, g, b (coloi), q (quality), iau, vi,
anu all custom G,/.,P "../$N:.,# alieauy uefineu by usei.
L$C3'$ !$E 7$(K;)?$ >##(3@<#$ Auu a new Pei-Face attiibute to cuiient
mesh. You can specify custom name anu a function to geneiate attiibute's
value. It's possible to use pei-face vaiiables in the expiession:
]Li[LiRL foi T0M#/ U"M/"]; x1,y1,z1 foi seconu veitex; x2,y2,z2 foi thiiu
veitex. anu also .]Li.[Li.RL nx1,ny1,nz1 etc. foi .*M-&S# anu MLiOLi'L
foi +*S*M,\Li\Yi\B foi \,&S0/[. name specifieu below can be useu in othei
filtei function
&(30 &$'$()#"( ueneiate a new 2B uiiu mesh with numbei of veitices on
X anu Y axis specifieu by usei with absolute lengthheight.
It's possible to centei uiiu on oiigin.
P-.*3?3# 1<(C)?$ ueneiate a new mesh that coiiesponus to the u valueu
isosuiface uefineu by the scalai fielu geneiateu by the given expiession
24
D$C3'$ T8$(KL$C3'$0 Refine cuiient mesh with usei uefineu paiameteis.
Specify a Boolean Function neeueu to select which euges will be cut foi
iefinement puipose. Each euge is iuentifieu with fiist anu seconu veitex.
Aiguments accepteu aie fiist anu seconu veitex attiibutes:
]Li[LiRL ]Yi[YiRY foi cooiu .]Li.[Li.RL .]Yi.[Yi.RY foi noimal
MLiOLi'L MYiOYi'Y foi coloi \L \Y foi quality.
Cooius foi new veitex on euge aie geneiateu with function x,y anu z
You can use ]Li[LiRL anu ]Yi[YiRY
6"". 1<@032383"' 1<(C)?$8 Apply Loop's Subuivision Suiface algoiithm. It
is an appioximate methou which subuiviue each tiiangle in foui faces. It
woiks foi eveiy tiiangle anu has iules foi extiaoiuinaiy veitices
=<##$(C*G 1<@032383"' 1<(C)?$8 Apply Butteifly Subuivision Suiface
algoiithm. It is an inteipolateu methou, uefineu on aibitiaiy tiiangulai
meshes. The scheme is known to be C1 but not C2 on iegulai meshes
D$-"2$ T'($C$($'?$0 A$(#$B Check foi eveiy veitex on the mesh if it is
iefeienceu by a face anu iemoves it
D$-"2$ L<.*3?)#$0 A$(#$B Check foi eveiy veitex on the mesh if theie
aie two veitices with same cooiuinates anu iemoves it
D$-"2$ U$(" >($) ;)?$8 Removes null faces (the one with aiea equal to
zeio)
D$-"2$ ;)?$8 E3#: $04$8 *"'4$( #:)'VVV Remove fiom the mesh all
tiiangles whose have an euge with lenght gieatei oi equal than a
thiesholu
M*<8#$(3'4 0$?3-)#3"' Collapse veitices by cieating a thiee uimensional
giiu enveloping the mesh anu uiscietizes them baseu on the cells of this
giiu
O<)0(3? R04$ M"**).8$ L$?3-)#3"' Simplify a mesh using a Quauiic
baseu Euge Collapse Stiategy, bettei than clusteiing but slowei
O<)0(3? R04$ M"**).8$ L$?3-)#3"' HE3#: #$B#<($I Simplify a textuieu
mesh using a Quauiic baseu Euge Collapse Stiategy, bettei than clusteiing
but slowei
/30."3'# 1<@032383"' 1<(C)?$8 Apply a plain subuivision scheme wheie
eveiy euge is split on its miupoint
D$K9(3$'# )** C)?$8 ?":$($'#*G Re-oiient in a consistent way all the faces
of the mesh
P'2$(# ;)?$8 9(3$'#)#3"' Inveit faces oiientation, flip the noimal of the
mesh
D$-"2$ !"' /)'3C"*0 ;)?$8 Remove non 2-manifolu euges by iemoving
some of the faces inciuent on non manifolu euges
D$-"2$ !"' /)'3C"*0 A$(#3?$8 Remove non 2-manifolu veitices, that
veitices wheie the numbei of faces that can be ieacheu using only face-
face connectivity is uiffeient fiom the numbei of faces actually inciuent
on that veitex.Typical example think to two isolateu tiiangles connecteu
by a single veitex builuing a 18:/0+"## shape.
M"-.<#$ '"(-)*8 C"( ."3'# 8$#8 Compute the noimals of the veitices of a
mesh without exploiting the tiiangle connectivity, useful foi uataset with
no faces
M"-.<#$ ?<(2)#<($ .(3'?3.)* 03($?#3"'8 Compute the piincipal
uiiections of cuivatuie with seveial algoiithms
2S
M*"8$ W"*$8 Close holes smallei than a given thiesholu
;($$N$ M<(($'# /)#(3B Fieeze the cuiient tiansfoimation matiix into the
cooius of the veitices of the mesh
>..*G ,()'8C"(- Apply tiansfoimation, you can iotate, tianslate oi scale
the mesh
&$"-$#(3? MG*3'0(3?)* T'E()..3'4 0nwiap the geometiy of cuiient
mesh along a clylinuiical equatoiial piojection. The cylinuiical piojection
axis is centeieu on the oiigin anu uiiecteu along the veitical H axis.
/61 .("Q$?#3"' HDP/61I Pioject a mesh (oi a point set) onto the NLS
suiface uefineu by itself oi anothei point set. This is the Robust Implicit
NLS (RINLS) vaiiant which is an extension of Implicit NLS pieseiving
shaip featuies using non lineai iegiession. Foi moie uetails see:
0ztiieli, uuennebauu anu uioss, 'Featuie Pieseiving Point Set Suifaces
baseu on Non-Lineai Keinel Regiession' Euiogiaphics 2uu9.
/61 .("Q$?#3"' H>711I Pioject a mesh (oi a point set) onto the NLS
suiface uefineu by itself oi anothei point set. This is the "+0,N/"$% *8$2.
#,. #:/D"%,# (APSS) vaiiant which is baseu on the local fitting of algebiaic
spheies. It iequiies points equippeu with oiienteu noimals.
Foi all the uetails about APSS see: uuennebauu anu uioss, 'Algebiaic
Point Set Suifaces', Siggiaph 2uu7, anuuuennebauu et al., 'Bynamic
Sampling anu Renueiing of APSS', Euiogiaphics 2uu8
/)(?:3'4 M<@$8 HDP/61I Extiact the iso-suiface (as a mesh) of a NLS
suiface uefineu by the cuiient point set (oi mesh)using the maiching
cubes algoiithm. The coaise extiaction is followeu by an accuiate
piojectionstep onto the NLS, anu an extia zeio iemoval pioceuuie.
This is the Robust Implicit NLS (RINLS) vaiiant which is an extension of
Implicit NLS pieseiving shaip featuies using non lineai iegiession. Foi
moie uetails see: 0ztiieli, uuennebauu anu uioss, 'Featuie Pieseiving
Point Set Suifaces baseu on Non-Lineai Keinel Regiession' Euiogiaphics
2uu9.
/)(?:3'4 M<@$8 H>711I Extiact the iso-suiface (as a mesh) of a NLS
suiface uefineu by the cuiient point set (oi mesh) using the maiching
cubes algoiithm. The coaise extiaction is followeu by an accuiate
piojection step onto the NLS, anu an extia zeio iemoval pioceuuie.
This is the "+0,N/"$% *8$2. #,. #:/D"%,# (APSS) vaiiant which is baseu on
the local fitting of algebiaic spheies. It iequiies points equippeu with
oiienteu noimals. Foi all the uetails about APSS see:
uuennebauu anu uioss, 'Algebiaic Point Set Suifaces', Siggiaph 2uu7, anu
uuennebauu et al., 'Bynamic Sampling anu Renueiing of APSS',
Euiogiaphics 2uu8
M"*"(3N$ ?<(2)#<($ HDP/61I Coloiize the veitices of a mesh oi point set
using the cuifvatuie of the unueilying suiface. This is the Robust Implicit
NLS (RINLS) vaiiant which is an extension of Implicit NLS pieseiving
shaip featuies using non lineai iegiession. Foi moie uetails see:
0ztiieli, uuennebauu anu uioss, 'Featuie Pieseiving Point Set Suifaces
baseu on Non-Lineai Keinel Regiession' Euiogiaphics 2uu9.
M"*"(3N$ ?<(2)#<($ H>711I Coloiize the veitices of a mesh oi point set
using the cuivatuie of the unueilying suiface. This is the "+0,N/"$% *8$2.
#,. #:/D"%,# (APSS) vaiiant which is baseu on the local fitting of algebiaic
26
spheies. It iequiies points equippeu with oiienteu noimals.
Foi all the uetails about APSS see: uuennebauu anu uioss, 'Algebiaic
Point Set Suifaces', Siggiaph 2uu7, anu uuennebauu et al., 'Bynamic
Sampling anu Renueiing of APSS', Euiogiaphics 2uu8
R8#3-)#$ ()03<8 C("- 0$'83#G Estimate the local point spacing (aka
iauius) aiounu each veitex using a basic estimate of the local uensity.
1-)** ?"-."'$'# 8$*$?#3"' Select the small uisconnecteu components of
a mesh.
7"388"' D$?"'8#(<?#3"' 0se the points anu noimal to builu a suiface
using the Poisson Suiface ieconstiuction appioach.
O<)*3#G /)..$( )..*3$( The filtei maps quality levels into colois using a
coloibanu built fiom a tiansfei function (may be loaueu fiom an exteinal
file) anu coloiizes the mesh veitexes. The minimum, meuium anu
maximum quality values can be set by usei to obtain a custom quality
iange foi mapping
/$8: R*$-$'# 1<@8)-.*3'4 Cieate a new layei populateu with a point
sampling of the cuiient mesh, At most one sample foi each element of the
mesh is cieateu. Samples aie taking in a unifoim way, one foi each
element (veitexeugeface); all the elements have the same piobabilty of
being choosen.
/"'#$?)(*" 1)-.*3'4 Cieate a new layei populateu with a point
sampling of the cuiient mesh; samples aie geneiateu in a ianuomly
unifoim way, oi with a uistiibution biaseu by the pei-veitex quality
values of the mesh.
1#()#3C3$0 ,(3)'4*$ 1)-.*3'4 Cieate a new layei populateu with a point
sampling of the cuiient mesh; to geneiate multiple samples insiue a
tiiangle each tiiangle is subuiviueu accoiuing to vaiious #./".$D$,C
stiategies. Bistiibution is often biaseu by tiiangle shape.
7"388"'K038J 1)-.*3'4 Cieate a new layei populateu with a point
sampling of the cuiient mesh; samples aie geneiateu accoiuing to a
Poisson-uisk uistiibution
A)(3)@*$ 0$'83#G L38J 1)-.*3'4 Cieate a new layei populateu with a
point sampling of the cuiient mesh; samples aie geneiateu accoiuing to a
Poisson-uisk uistiibution
W)<80"(CC L38#)'?$ Compute the Bausuoiff Bistance between two
meshes, sampling one of the two anu finuing foieach sample the closest
point ovei the othei mesh.
,$B$* 1)-.*3'4 Cieate a new layei with a point sampling of the cuiient
mesh, a sample foi each texel of the mesh is geneiateu
A$(#$B >##(3@<#$ ,()'8C$( Tiansfei the choosen pei-veitex attiibutes
fiom one mesh to anothei. 0seful to tiansfei attiibutes to uiffeient
iepiesentations of a same object. Foi each veitex of the taiget mesh the
closest point (not veitex!) on the souice mesh is computeu, anu the
iequesteu inteipolateu attiibutes fiom that souice point aie copieu into
the taiget veitex. The algoiithm assumes that the two meshes aie
ieasonably similai anu aligneu.
T'3C"(- /$8: D$8)-.*3'4 Cieate a new mesh that is a iesampleu
veision of the cuiient one. The iesampling is uone by builuing a unifoim
volumetiic iepiesentation wheie each voxel contains the signeu uistance
27
fiom the oiiginal suiface. The iesampleu suiface is ieconstiucteu using
the -&M+$0.O +,'" algoiithm ovei this volume.
A"("'"3 A$(#$B M*<8#$(3'4 Apply a clusteiing algoiithm that builus
voionoi cells ovei the mesh staiting fiom ianuom points,collapse each
voionoi cell to a single veitex, anu constiuct the tiiangulation accoiuing
to the clusteis aujacency ielations. veiy similai to the technique
uesciibeu in j1VVM*]0-&/"N E"./M*0N&S F*M*.*0 )0&OM&-# T*M
9.0T*M- C*S[O*.&S !"#$ E*&M#".0.Oj - valette Chasseiy - Euiogiaphics
2uu4
A"("'"3 A$(#$B M"*"(3'4 uiven a Nesh ! anu a Pointset C, The filtei
pioject each veitex of P ovei N anu coloi N accoiuing to the geouesic
uistance fiom these piojecteu points. Piojection anu coloiing aie uone on
a pei veitex basis.
L38J A$(#$B M"*"(3'4 uiven a Nesh ! anu a Pointset C, The filtei pioject
each veitex of P ovei N anu coloi N accoiuing to the geouesic uistance
fiom these piojecteu points. Piojection anu coloiing aie uone on a pei
veitex basis.
D$4<*)( D$?<(832$ 1)-.*3'4 The bbox is ieciusively paititioneu in a
octiee style, centei of bbox aie consiueieu, when the centei is neaiei to
the suiface than a given thi it is piojecteu on it. It woiks also foi builuing
ofsetteu samples.
1$*$?# >** Select all the faces of the cuiient mesh
1$*$?# !"'$ Cleai the cuiient set of selecteu faces
L$*$#$ 1$*$?#$0 ;)?$8 Belete the cuiient set of selecteu faces, veitices
that iemains uniefeienceu aie not ueleteu.
L$*$#$ 1$*$?#$0 ;)?$8 )'0 A$(#3?$8 Belete the cuiient set of selecteu
faces anu all the veitices suiiounueu by that faces.
R("0$ 1$*$?#3"' Eioue (ieuuce) the cuiient set of selecteu faces
L3*)#$ 1$*$?#3"' Bilate (expanu) the cuiient set of selecteu faces
1$*$?# ="(0$( ;)?$8 Select all the faces on the bounuaiy
P'2$(# 1$*$?#3"' Inveit the cuiient set of selecteu faces
1$*$?# @G A$(#$B O<)*3#G Select all the faces with all the veitexes within
the specifieu quality iange
1$*$?# ;)?$ @G A$(#$B M"*"( Select pait of the mesh baseu on its coloi.
/"2$ 8$*$?#3"' "' )'"#:$( *)G$( Selecteu faces aie moveu (oi
uuplicateu) in a new layei
L<.*3?)#$ ?<(($'# *)G$( Cieate a new layei containing the same mouel as
the cuiient one
7*)')( C*3..3'4 ".#3-3N)#3"' Nesh optimization by euge flipping, to
impiove local tiiangle quality
M<(2)#<($ C*3..3'4 ".#3-3N)#3"' Nesh optimization by euge flipping, to
impiove local mesh cuivatuie
6).*)?3)' 8-""#: H8<(C)?$ .($8$(2$I Laplacian smooth without suiface
mouification: move each veitex in the aveiage position of neighbois
veitices, only if the new position still (almost) lies on oiiginal suiface
M<# -$8: )*"'4 ?($)8$ $04$8 Cut the mesh along ciease euges,
uuplicating the veitices as necessaiy. Ciease euges aie uefineu accoiuing
to the vaiiation of noimal of the aujacent faces
28
6).*)?3)' 1-""#: Laplacian smooth of the mesh: foi each veitex it
calculates the aveiage position with neaiest veitex
WM 6).*)?3)' 1-""#: BC Laplacian Smoothing, extenueu veision of
Laplacian Smoothing, baseu on the papei of vollmei, Nencl, anu Nullei
1?)*$L$.$'0$'# 6).*)?3)' 1-""#: Scale Bepenuent Laplacian
Smoothing, extenueu veision of Laplacian Smoothing, baseu on the
Fujiwaia extenueu umbiella opeiatoi
,E"1#$. 1-""#: Two Step Smoothing, a featuie pieseivingenhancing
faiiing filtei. It is baseu on a Noimal Smoothing step wheie similai
noimals aie aveiageu togethei anu a step wheie the veitexes aie fitteu on
the new noimals
,)<@3' 1-""#: The $lambua-mu$ taubin smoothing, it make two steps of
smoothing, foith anu back, foi each iteiation
L$.#: 1-""#: A laplacian smooth that is constiaineu to move veitices
only along the view uiiection.
L3($?#3"')* &$"-V 7($8$(2V Stoie anu Blenu the cuiient geometiy with
the iesult of anothei pievious smoothing piocessing step. It is useful to
limit the influence of any smoothing algoiithm along the viewing
uiiection. This is impoit to cope with the biaseu uistiibution of the eiioi
in many scanning uevices. T0F scannei usually have veiy goou ]i[
accuiacy but suffei of gieat uepth eiiois.
1-""#: 2$(#$B F<)*3#G Laplacian smooth of the quality values.
1-""#: ;)?$ !"(-)*8 Smooth Face Noimals without touching the
position of the veitices.
T'1:)(. /)8J !"(-)*8 0nshaip mask filteiing of the noimals, putting in
moie eviuence noimal vaiiations
T'1:)(. /)8J &$"-$#(G 0nshaip mask filteiing of geometiic shape,
putting in moie eviuence iiuges anu valleys vaiiations
T'1:)(. /)8J O<)*3#G 0nshaip mask filteiing of the quality fielu
T'1:)(. /)8J M"*"( 0nshaip mask filteiing of the coloi, putting in moie
eviuence coloi euge vaiiations
D$?"-.<#$ A$(#$B !"(-)*8 Recompute veitex noimals as an aiea
weighteu aveiage of noimals of the inciuent faces
D$?"-.<#$ S$34:#$0 A$(#$B !"(-)*8 Recompute veitex noimals as a
weighteu sum of noimals of the inciuent faces. Weights aie uefineu
accoiuing to the papei =,$01.# D8/ 78)*:.$20 R,/.,P F8/)"+# D/8) 9"%,.
F8/)"+#, Nelson max, }uT 1999
D$?"-.<#$ >'4*$ S$34:#$0 A$(#$B !"(-)*8 Recompute veitex noimals
as an angle weighteu sum of noimals of the inciuent faces accoiuing to the
papei 78)*:.$20 R,/.,P F8/)"+# D/8) A8+6082"+ 9"%,., u Thuimei, CA
Wuthiich, }uT 1998
D$?"-.<#$ ;)?$ !"(-)*8 Recompute face noimals as the noimal of the
plane of the face
!"(-)*3N$ ;)?$ !"(-)*8 Noimalize Face Noimal Lenghts
!"(-)*3N$ A$(#$B !"(-)*8 Noimalize veitex Noimal Lenghts
A$(#$B 63'$)( /"(.:3'4 Noiph cuiient mesh towaius a taiget with the
same numbei of veitices. The filtei assumes that the two meshes have
also the same veitex oiueiing.
29
D$-"2$ @"(0$( C)?$8 Remove all the faces that has at least one boiuei
veitex.
!"38G P8"8<(C)?$ Cieate a isosuiface peituibeu by a noisy isosuiface.
M"*"(3N$ @G @"(0$( 038#)'?$ Stoie in the quality fielu the geouesic
uistance fiom boiueis anu coloi the mesh accoiuingly.
D)'0"- 2$(#$B 038.*)?$-$'# Nove the veitices of the mesh of a ianuom
quantity.
;*)##$' 2383@*$ *)G$(8 Flatten all oi only the visible layeis into a single
new mesh. Tiansfoimations aie pieseiveu. Existing layeis can be
optionally ueleteu
A$(#$B M"*"( !"38$ Ranuomly auu a small amount of a ianuom base coloi
to the mesh

<0-VS0T0+&/0*.

Simplification filteis aie filteis that get in input a mesh anu builu anothei mesh
composeu by a smallei numbei of tiiangles. Theie aie thiee simplification filteis
insiue NeshLab

ES,#/"M0.O. Baseu on a simple veitex clusteiing appioach. A unifoim giiu
is useu to collapse all the veitices falling in the same giiu cell onto a single
veitex. It is a veiy fast algoiithm but not veiy accuiate, a bounu of the
intiouuceu eiioi is half of the uiagonal of each giiu cell. Topological
inconsistencies aie quite piobable that will be cieateu (282 )"2$D8+C
,C0,#). This is a typical uiawback of any clusteiing-baseu simplification
algoiithms. In oui implementation the only paiametei that can be
specifieu by the usei is the length of the siue of the cubic giiu cell. This
length can be intiouuceu eithei as an absolute value in the space of the
mesh itself, oi as a peicentage of the uiagonal of the bounuing box of the
object. With this kinu of appioach you cannot know in auvance the final
size of the mesh, but only knowing what coulu be at the enu the final
aveiage euge length (e.g. appiox. the same of the giiu cell siue).

>,&NM0+ "NO" +*SS&V#". A vaiiant of the well known euge collapse
algoiithm baseu on quauiic eiioi metiic pioposeu by Nichael uailanu
anu Paul Beckbeit . The usei can contiol the quality of the simplification
thiough some paiameteis:
o Quality thiesholu foi penalizing euge collapses that cieates bau
shapeu faces.The value is in the iange |u..1j (u a uegeneiate
tiiangle 1 a equilateial one); the value of this paiametei must be
inteipieteu as follows:
! u accept any kinu of face (no penalties),
! B penalize faces with quality than B, piopoitionally to theii
shape quality.
o Noimal checking foi penalizing euge collapses that flip the noimal
of the oiiginal suifaces (it can help to avoiu some nasty aitifacts
that can aiise in veiy flat aieas).

>,&NM0+ "NO" +*SS&V#" P0/$ /"]/,M" +**MN0.&/"# VM"#"MU&/0*.
Su

C*0./ C0+X0.O 6**S

)"#+M0V/0*.
This tool can basically be uesciibeu as a mesh labeling tool. It allows you to pick
anu name points on a mesh anu save the output to xml.

The tool has two main moues, noimal anu template moue. Template moue is
uesciibeu below. Theie aie two main moues of inteiaction with the points, C0+X
C*0./, !*U" C*0./, anu <"S"+/ C*0./ moue. The moue of inteiaction is inuicateu
by the iauio at the top. In pick moue you auu new points to the mesh by iight
clicking on the mesh. In move moue you can move a point by iight clicking neai
the point anu uiagging it to a uiffeient location. In select moue you can iight click
a point on the mesh anu it will be highlighteu in the pick points euit tool menu.
Beie aie some notes about the &+/0U" checkbox. The immeuiate affect of
checking the active checkbox is to hiueshow the pickeu point on the mesh. This
featuie is meant to allow you to use a template foi which some scan uata will
have one of the template points missing. In this case you can unflag this point,
labeling it in-active. When points aie auueu you have a gieen cone, iepiesenting
the noimal, with a label next to it. You can also choose at the bottom wheie it
says 4*M-&S :V/0*.# to have just a uot, which is the point, a label foi that point,
oi a uot, label, anu a gieen line which iepiesents the noimal of the face the point
is on.

,$-.*)#$ /"0$
Summaiy: Templates aie use to facilitate the labeling of many meshes with the
same labels. If you have a template loaueu you aie in Template Noue. The name
of the template will be wiitten in blue letteis next to the place at the bottom
wheie it says "Template Name:". "No Template Loaueu" will be piinteu if no
template is loaueu. In Template moue you will only be able to pick anu move the
points that aie alieauy uefineu as pait of the template. 0se the 1NN C*0./ anu
;"-*U" C*0./ buttons in the Template Contiols aiea to mouify a template. You
can also stait fiom sciatch, pick some points, then save them as a template
(saving the names so you can use them foi othei meshes).

1)23'456")03'4 7"3'#8
Points aie saveu to & ]-S T0S" by using the #&U" ',//*. at the top. Points can be
loaueu fiom a file by piessing the loau button. Alteinately points aie
&,/*-&/0+&SS[ S*&N"N TM*- & T0S" if you hau pieviously saveu them using the
filename iecommenueu by the tool. Points aie #&U"N /* C"M!"#$1//M0',/"#
automatically when you close the euit plugin anu loaueu back fiom
PeiNeshAttiibute when the plugin is loaueu. This takes pieceuent ovei loauing
points fiom a file.

9#:$( ;$)#<($8
1. Rename a point by slowly uouble clicking on it
2. 0nuo: will unuo only that last move


S1
9#" G0/$ ^1S0O. !"#$ ,#0.O C0+X"N C*0./#^ T0S/"M
In oiuei to use the 1S0O. !"#$ ,#0.O C0+X"N C*0./# filtei you neeu to have
eithei saveu points:
1. to PeiNeshAttiibutes oi
2. to a file with the name suggesteu by the point picking plugin.
Note: that points aie only neeueu if "0se Naikeis foi Alignment" is checkeu.
Note: that if "Scale the mesh" is checkeu then you neeu points anu to have
checkeu "0se Naikeis foi Alignment".
Note: the tiansfoim calculateu is stoieu in pei mesh uata with key
AlignTools::getKey()

4*/"# T*M )"U"S*V"M# P$* P&./ /* ,#" V0+X"N V*0./# 0. /$"0M VS,O0.

You can look at how the filtei FP_ALIuN_WITB_PICKEB_P0INTS in the cleanfiltei
plugin uses points pickeu by the euit_pickpoints plugin. Note, most coue is heie,
cleanfilteicleanfiltei.cpp but the impoitant bit is heie:
NeshNouel *stuckNouel = pai.getNesh(StuckNesh); PickeuPoints
*stuckPickeuPoints = u; ... fiist tiy to get points fiom memoiy
if(vcg::tii::BasPeiNeshAttiibute(stuckNouel->cm, PickeuPoints::Key) ) {
CNesh0::PeiNeshAttiibuteBanule<PickeuPoints*> ppBanule =
vcg::tii::Allocatoi<CNesh0>::uetPeiNeshAttiibute<PickeuPoints*>(stu
ckNouel->cm, PickeuPoints::Key); stuckPickeuPoints = ppBanule();

What you get is a PickeuPoints object. To see what it uoes look heie
meshlabpluginseuit_pickpointspickeuPoints.h(cpp).
Basically what you neeu to know is that this class holu a
stu::vectoi<PickeuPoint*> wheie a PickeuPoint is a simple object that has two
membeis:
1. name of point: QStiing name;
2. point: vcg::PointSf point;

:/$"M 0.T*M-&/0*.
souice coue in euit_pickpoints foluei

!*MV$"M 6**S

)"#+M0V/0*.
This is a faiily simple plugin that allows you to moiph between any two meshes
that have the same numbei of veitexes. The moiph is calculateu anu uisplayeu in
ieal time as you sliue the sliuei.

)"/&0S#
The moiph is a simple lineai moiph between the coiiesponuing points.
Example: A moiph of Su calculates the point Su% between the fiist point
of mesh A anu the fiist point of mesh B, then goes on to the seconu point,
etc
N0TE: uoes compact the mesh iemoveing ueleteu elements using
Allocatoi<NyNesh>::Compactveitexvectoi(m);anu
Allocatoi<NyNesh>::CompactFacevectoi(m);
S2
:/$"M 0.T*M-&/0*.
souice coue in filtei_moiph foluei


!%< <,MT&+"#

Noving least squaies (NLS) filteis pioviue suite of tools built upon vaiious
meshless suiface uefinitions. The set of suppoiteu NLS suifaces vaiiants incluue:
Auamson anu Alexa's point set suifaces baseu on noimal aveiaging
(special case of APSS),
uuennebauu anu uioss's algebiaic point set suifaces (APSS) which aie
baseu of spheie fitting,
Kolluii's implicit NLS vaiiant of Shen et al. appioach.

Note that all these uefinitions iequiie veitices equippeu with oiienteu noimals.
If no local iauius is pioviueu, then they aie automatically computeu using the
Point SetRauius estimation filtei. All NLS filteis take as input a point set (oi the
veitices of a mesh), implicitly uefine the unueilying suiface, anu then peifoim
vaiious opeiations such as:
!"#$0.O of the suiface using a maiching cube algoiithm.
<-**/$0.O by mean of a piojection onto the unueilying NLS suiface. It is
possible to piojectsmooth the input veitices themself, oi any othei set of
points of meshing assuming they aie close enough to the taiget suiface
(cuiiently). If the geometiy to pioject is a mesh, then it is possible to
iefine it uuiing the piojection accoiuing to some local eiioi metiics (heie
the angle between two aujacent faces).
E,MU&/,M" VS*/#: coloiizes the veitices of a point set (oi mesh) accoiuing
to the cuivatuie of the unueilying NLS suiface. It pioviues exact analytics
cuivatuie computations foi the uauss, mean anu piincipal cuivatuies.
Filteis highly ielateu to point set suifaces incluues:
C*0./ <"/a;&N0,# "#/0-&/0*. which computes the local point spacing of
each veitices of a point set. This filtei use a basic estimate of the local
uensity using the k neaiest neighbois anu assuming a locally unifoim anu
flat sampling.
4*M-&S#aE*-V,/" TM*- V*0./ #"/ which can be useu to compute
oiienteu noimals of a iaw point clouu.
<"S"+/a<-&SS +*-V*."./# which can be useu to select (anu then
iemove) all the extia zeio components which can appeais aftei a
maiching cube ieconstiuction of the NLS suiface.

>$,SS @0S/"M

3"."M&S )"#+M0V/0*.
The Qhull Filtei plugin is a collection of filteis useu foi computing the convex
hull, Belaunay tiiangulation, voionoi Filteiing anu Alpha Shapes ovei the mesh.
It also incluues a filtei foi the selection of the visible points fiom a given
viewpoint. Eveiy single filteis uses the Qhull libiaiy foi mathematical
opeiations.
SS
@,.+/0*. @0S/"M %0#/

E*.U"] ?,SS

This filtei computes the %82G,P 1:++ of the cuiient mesh. It is containeu in the
Remeshing filtei class. The convex hull of a set of points is the bounuaiy of the
minimal convex set containing the given non-empty finite set of points.
The filtei takes the mesh veitices anu builus a new mesh that contains the
convex hull. Beie it is the Qhull libiaiy uocumentation of the piogiam that
calculates the convex hull of a set of points. The iesult is 2-manifolu by
uefinition, so it is possible to ie-oiient all faces coheiently.


0iiginal image

Convex Bull

)"S&,.&[ 6M0&.O,S&/0*.

This filtei computes the ;,+":2"6 ./$"20:+".$82 of the cuiient mesh. It is
containeu in the Remeshing filtei class. The Belaunay tiiangulation BT(S) of a set
of points S in u-uimensional spaces is a tiiangulation of the convex hull such that
no point in S is insiue the ciicum-spheie of any simplex in BT(S).
The filtei takes the mesh veitices anu builus a new mesh that contains the
Belaunay tiiangulation. Beie it is the Qhull libiaiy uocumentation of the
piogiam that calculates the Belaunay tiiangulation of a set of points S.


0iiginal image

Belaunay Tiiangulation

F*M*.*0 @0S/"M0.O

The filtei implements a R8/828$ D$+.,/$20 on the cuiient mesh. It is containeu in
the Remeshing filtei class. The algoiithm computes a piecewise-lineai
appioximation of a smooth suiface fiom a finite set of sample points that uefines
a "well-sampleu" cuive. It uses a subset of the voionoi veitices to iemove
tiiangles fiom the Belaunay tiiangulation. The algoiithm picks only two voionoi
veitices, calleu *8+,#, pei sample point: the faithest veitices of the point's cell on
each siue of the suiface.
S4

Beie it is the main steps pioposeu by ?),2." "2C !,/2 (1998):
1. Compute the voionoi uiagiam of the sample points S.
2. Foi each sample point s uo:
1. If s uoes not lie on the convex hull of S, let p+ be the veitex of
voi(s) faithest fiom s.
2. If s uoes lie on the convex hull, let p+ be a point at "infinite
uistance" outsiue the convex hull with the uiiection of sp+ equal to
the aveiage of the outwaiu noimals of hull faces meeting at s.
S. Pick the veitex p- of voi(s) faithest fiom s with negative
piojection onto sp+.
S. Let P uenotes all poles p+ anu p-,except those p+'s at infinitive uistance.
Compute the Belaunay tiiangulation of S 0 P.
4. (voionoi filteiing) Keep only those tiiangles in which all thiee veitices
aie sample points.

The filtei allows the usei to choose a .1/,#18+C, a factoi that uefines a iange (u-
thiesholu*bbox.Biag()) useu to uiscaiu the voionoi veitices too fai fiom the
oiigin. They can cause pioblems to the qhull libiaiy. uiowing values of .1/,#18+C
will auu moie voionoi veitices foi a bettei suiface ieconstiuction.

1SV$& <$&V"#

The filtei computes the ?+*1" (1"*, (Euelsbiunnei anu P.Nucke 1994) of the
cuiient mesh. It is containeu in the Remeshing filtei class. Fiom a given finite
point set in the space it computes the #1"*, of the set. The alpha shape is the
bounuaiy of the alpha complex, that is a subcomplex of the Belaunay
tiiangulation of the given point set S. Foi a given value of 'alpha', the alpha
complex incluues all the simplices in the Belaunay tiiangulation which have an
empty ciicumspheie with iauius equal oi smallei than 'alpha'. Beie 'empty'
means that the open shpeie uo not incluue any points of S.

The algoiithm uses the geneial-position assumption by Euelsbiunnei anu
P.Nucke that states that no smallest ciicumspheie of two oi thiee points of S
contains anothei point of S.

If a spheie contains thiee points of S then no two of them aie antipoual, anu if it
contains foui points then no thiee lie on a gieat-ciicle of the spheie. (?7@
Q/"2#$.$82 82 U/"*1$%#` R8+& 3L` 28 3` b"2:"/6 3''M). 'alpha' contiols the uesiieu
level of uetail of the shape. Note that foi 'alpha' = u, both the alpha complex anu
the alpha shape consist just of the set S, anu foi sufficiently laige 'alpha', the
alpha complex is the Belaunay tiiangulation BT(S) of S, insteau the alpha shape
is the convex hull of S. The alpha value is computeu as peicentage of the uiagonal
of the box. 0sei can choose to get the alpha complex oi the alpha shape of the
mesh. The filtei inseits the minimum value of alpha (the ciicumiauius of the
tiiangle) in attiibute Quality foi each face, so it can be easiei to uefine a filtiation
on the mesh (.1, "+*1" #1"*,#).


SS
Images foi alpha complexes

0iiginal image

Alpha=S1.S4

Alpha=8S.S7

Alpha=29u.92
.
Images foi alpha shapes

0iiginal image

Alpha=2

Alpha=S

Alpha=4

<"S"+/ F0#0'S" C*0./#

The filtei selects the visible veitices of the cuiient mesh, as vieweu fiom a given
viewpoint. It is containeu in the Selection anu Point Set filtei class.
The algoiithm useu (Katz, Tal anu Basii 2uu7) ueteimines visibility without
ieconstiucting a suiface oi estimating noimals. A point is consiueieu visible if its
tiansfoimeu point lies on the convex hull of a tiansfoimeu points clouu fiom the
oiiginal given points. Beie it is the equation useu to peifoim the spheiical
flipping (Katz et al. 2uuS):

f(p)= p + 2*(R - ||p||)*p||p||

It is impoitant to choose a suitable value foi R. As R incieases, moie points pass
the thiesholu of the convex hull anu hence aie maikeu as visible. A laige R is
suitable foi uense point clouus, anu a small R foi spaise clouus. The iauius is
computeu as the uistance between the viewpoint anu its faithest point anu then
aujusteu with a paiametei (.1/,#18+C)inseiteu by the usei. iauius=uistance
between the centei anu its faithest point * 1u^thiesholu. 0sei can choose to use
the Neshlab Cameia as the viewpoint oi inseit his own one. 0sei can also choose
to show the paitial convex hull of the tiansfoimeu points (the viewpoint is not
incluueu) anu a mesh connecting the visible points accoiuing to the connectivity
of the flippeu ones. It is also possible to ie-oiient all faces coheiently.

<,VV*M/"N @*M-&/#
S6

The following foimats aie suppoiteu by NeshLab

2-V*M/
PLY, ascii anu binaiy. Nany vaiiants suppoiteu. Tiiangle stiip loauing
suppoiteu. ply Range map foimat still not suppoiteu
STL, ascii anu binaiy. Coloi not suppoiteu.
0FF,
0B},
SBS,
C0LLABA,
PTX

5]V*M/
PLY,
STL,
0FF,
0B},
SBS,
C0LLABA,
vRNL,
BXF
0SB

E*-V0S0.O N"U"S

G$&/ [*, .""N
To compile NeshLab you neeu a C++ compiling enviionment, (we iegulaily
compile meshlab unuei visualStuuio 2uuS, gcc anu xcoue) anu the following
libiaiies:
Qt 4.4 (note that Qt 4.4 aie /,c:$/,C, Qt veisions < 4.4 coulu not compile).
Cuiient veision of NeshLab compiles well against Qt 4.4.S.
A svn-client (foi a list of existing svn-clients you coulu take a look heie).
the vCu libiaiies; http:vcg.sf.net, this libiaiy is not uistiibuteu by
means of easy-to-uownloau packages, but it is only accessible thiough
anonymous svn (svn stiing: #G2 %8
1..*#KddG%0&#G2&#8:/%,D8/0,&2,.d#G2/88.dG%0 G%0 ). If you get the cuiient
veision of the vCu libiaiy we suggest you to also get the cuiient veision
of NeshLab. If you want to compile the uistiibuteu souices check out fiom
the iepositoiy the vCu lib with the same uate of the ielease of NeshLab.
NeshLab's souice coue available via SouiceFoige svn seivei. Foi fuithei
uetails please iefeis to the following section

3"//0.O /$" #*,M+"#
Foi getting the latest veision of NeshLab you have to anonymously access the
NeshLab #U. tiee as explaineu in the souicefoige page
http:souicefoige.netsvn.gioup_iu=149444; foi the lazy ones, to get the iight
subset of the svn tiunk in the N"U"S foluei you shoulu issue the following svn
commanu:
S7
svn co https:meshlab.svn.souicefoige.netsvniootmeshlabtiunkmeshlab
meshlab svn co https:vcg.svn.souicefoige.netsvniootvcgtiunkvcglib
vcglib

5]/"M.&S )"V".N".+0"#

NeshLab anu NeshLab's plugins invokes functions expoiteu by exteinal
libiaiies. The coue of all these libiaiies is incluueu in the NeshLab's cuiient
uevelopment veision uownloauable via svn. You can finu it in the foluei
~uevelmeshlabsicexteinal.
glew ( http:glew.souicefoige.net ), stiongly iequiieu. You just neeu
the souices (.h anu .c), (not the compileu libs), glew is statically compileu
into meshlab, so no uynamic libiaiies aie iequiieu.
libSus-1.S.u ( http:libSus.souicefoige.net ) This one is neeueu only foi
the io_Sus plugin. Without this plugin the Sus file foimats will not be
paiseu.
bzip2-1.u.S this one is iequiieu only foi the epoch foimat impoit plugins;
if you uo not have uatasets piouuceu with the aicSB web ieconstiuction
seivice, you uo not neeu this plugin.
muPaisei 1.Su ( http:mupaisei.souicefoige.net ) This libiaiy is
neeueu foi filtei_func plugin.
In oiuei to successfully compile a NeshLab's plugin with exteinal uepenuency
you have befoie to compile the iefeiieu libiaiy anu put it into the foluei
~uevelmeshlabsicexteinallibY00R_0S wheie Y00R_0S is a stiing ielateu
to youi opeiating system anu compilei accoiuing to QNAKESPEC uefinition (like
foi example )"%P oi H$2LEV)#G%E44O).
Into the foluei ~uevelmeshlabsicexteinal a .pio file, exteinal.pio, has been
pioviueu to easily compile all the exteinal libiaiies. To uo this you can eithei:
use a Qt-fiienuly IBE, like Qt Cieatoi, visual Stuuio oi Eclipse (the last two
with the IBE's Qt integiation pioviueu by Tiolltech)
use commanu line.
qmake -iecuisive exteinal.pio make

> '"#$: when we say that a libiaiy is neeueu only foi a specific plugin we mean
that if you uo not have that libiaiy you shoulu not tiy to compile that specific
plugin otheiwise the compilation of that plugin coulu fail on that plugin anu,
uepenuing on youi compiling enviionment, the whole compilation coulu stop. To
avoiu the compilation of pioblematic plugins simply comments the ielative line
(auuing a # at the beginning of the line) in the
sicmeshlabpluginsmeshlabpluginsv12.pio.

E*N" /M"" #/M,+/,M"
The meshlab souices anu the vcg libiaiy must be at the same level anu the vcg
libiaiy ioot shoulu be nameu 'vcglib'. The exteinal compileu libiaiies shoulu be
placeu in a uii nameu ~uevelmeshlabexteinallibY00R_0S (see the above
section).
You shoulu have setup youi uiiectoiies in a way that shoulu be similai to the
following ones (obviously you aie not foiceu to call youi base uii uevel oi to put
it unuei youi home uii):
S8
~uevelvcglibvcgspace ~uevelmeshlabsicmeshlabinteifaces.h
~uevelmeshlabexteinallibY00R_0S
If you put things in uiis with uiffeient ielations, you have to manually change the
.pio. Please note that if you aie a uevelopei that will soon oi latei submit back its
woik, it is stiongly uepiecateu that you use youi own veision of .pio files: use
the stanuaiu setup.

E*-V0S0.O
The compiling step uepenus on the compiling enviionment. 0sing uCC (both
unuei linux anu using the mingw gcc pioviueu with the fiee Qt uistiibution) you
shoulu just type, fiom the C,G,+d),#1+"Nd#/% uiiectoiy:
qmake -iecuisive meshlabv12.pio make
the C,G,+d),#1+"Nd#/% uiiectoiy contains also the ),#1+"Ne)$2$&*/8 pioject that
contains a much smallei set of the meshlab plugins. It is easiei to catei foi (no
neeu foi libSus anu bzip) anu compiles fastei.
0nuei winuows the suggesteu platfoim is the one foimeu by the open souice
veision of Qt with the mingw gcc compilei that is kinuly incluueu in the open
souice Qt uistiibution available fiom TiollTech.
If you want to use visual Stuuio, please N:6 the commeicial veision of Qt that
offeis a nice integiation of the Qt tools into the visual Stuuio IBE. In that case you
simply have to impoit the top level pio ( fdC,G,+d),#1+"Nd#/%d),#1+"N&*/8 ) into
visualStuuio.

9#0.O !0+M*#*T/ F0#,&S </,N0* = "]VM"## "N0/0*. &.N >6
It is possible to use the visual Stuuio 8 expiess euition (the one fiee fiom NS).
Simple steps foi the lazy ones:
uownloau anu install Niciosoft visual Stuuio 8 expiess euition
uownloau fiom tiolltech QT 4.4.S , the zip with the souices not the
piecompileu bin foi mingw.
unzip it anu iename the cieateu foluei to c:\Qt\4.4.S (oi something
uiffeient if you alieauy have installeu the qt uistiibution with mingw.
Now open the visual stuuio console (piogiam files->visual stuuio 2uu8->
vs 2uu8 tools-> vs 2uu8 commanu piomt). uo to the uiiectoiy wheie you
unzippeu qt anu type configuie -uebug-anu-ielease. Wait a few mins (it
compiles qmake anu iuns it, cieating the makefiles foi vs2uu8)
type nmake. Wait a few houis (it iecompiles the whole Qt).
last step: piepaie the enviionment; you have to auu to the enviionment of
vs8 commanu piompt:
set QTBIR=C:\Qtvs\4.4.S set PATB=C:\Qtvs\4.4.S\bin set
PATB=%PATB%;%SystemRoot%\SystemS2 set QNAKESPEC=winS2-msvc2uu8
aftei that just stait that enhanceu vs8 commanu piompt, go in the
appiopiiate uii, type
qmake -tp vc -iecuisive meshlabv12.pio
anu magically a solution that contains meshlab anu all the plugins will
appeai.
In some cases it coulu help also to configuie visual C++, so it can see
always Qt: (tools->options) anu auu: $(QTBIR)\incluue to the incluue
uiiectoiies anu $(QTBIR)\lib to the lib uiiectoiies, but it shoulu not be
iequiieu (anu peihaps a bit uangeious if you upgiaue qt).
S9


GM0/0.O & CS,O0.

NeshLab has a ieasonably mouulai aichitectuie, most of its functionalities aie
implementeu as uynamically loaueu plugins. To extenu meshlab with new
functionalities you have to wiite new plugins. Theie is a fixeu small set of
possible plugins types foi meshlab, the most impoitant ones aie:
T0S/"M VS,O0.#. The most common class of plugins. These plugins
implement stiaight mesh filteiing opeiations, e.g. pioceuuies that take in
input a mesh anu a set of paiameteis anu mouifies it accoiuing to some
algoiithm (smoothing, cleaning, simplification etc). Note that the
paiametei asking thiough a uialog is usually manageu by the meshlab
fiamewoik. These filteis can be useu also fiom meshlabseivei the
commanu line veision of the meshlab.
0a* VS,O0.#. These plugins implement file paising mechanism. They can
iequiie paiameteis befoie anu aftei the piocessing of the file, foi example
to ueciue if a mesh has to be saveu in binaiy foimat oi not, oi to loau only
a subset of the oiiginal uata, oi to peifoim some kinu of stanuaiu
postpiocessing on the input mesh (like foi example stl veitex unification).
"N0/ VS,O0.#. These plugins implement functionalities that iequiie non-
tiivial usei input anu uiiect mesh inteiaction, like painting, selection,
measuiing anu that coulu iequiie a complex custom uialog.
o N0TE: The euit plugins cannot be useu fiom meshlabseivei.
o NeshEuitInteiface Implementation uuiue
You can finu veiy simple examples of the above uesciibeu plugins in the
),#1+"Nd#/%d#")*+,*+:0$2#d uiiectoiy.
0bviously following the couing iecommenuation is always waimly suggesteu.
The new plugins shoulu be nameu accoiuing to the following naming stiategy:
euit plugins shoulu be nameu ,C$.e#8),.1$20
filtei plugins shoulu be nameu D$+.,/e#8),.1$20
io plugins shoulu be nameu $8e#8),.1$20
The name of the plugin anu of the .pio file shoulu be the same of the uiiectoiy
name.
0bviously, once you have succeeu to set up the fiamewoik foi youi plugin, you
have to actually make something on youi mesh. Foi an intiouuction on how
access the elements of the mesh anu how to usemouify them look at the pages
that explains how accessing the mesh anu what algoiithms aie piesent in the vcg
libiaiy.

!"#$ )&/& #/M,+/,M"
Two cents on the basic types insiue NeshLab, whose ueclaiation aie in
meshmouel.h:
the basic uocument type is a !"#$)*+,-"./ that is basically a list of
!"#$!*N"S.
each !"#$!*N"S coiiesponus to one layei anu contains a vcg mesh of
type E!"#$:
4u
E!"#$: is the vcg mesh type (a vcg::tiimesh ) that you shoulu pioviue to
the vaiious vcg Algoiithms anu fiom which you shoulu get FaceIteiatois,
veitexIteiatois anu otheis types...
So foi example when you open a file, a new NeshBocument is cieateu, with a
single layei that contains the loaueu mesh. Some filteis can cieate oi uestioy
layeis, foi example the sampling filteis usually cieate a new layei containing the
sampleu point clouus. Filteis can woik oi on a single layei oi on all the layeis.
It is veiy impoitant that filteis keep coheient anu upuateu the set of elements
that aie cuiiently active foi a given mesh, like foi example colois, cuivatuie,
aujacency etc.

GM0/0.O [*,M T0M#/ T0S/"M
Fiist suggestion, stait with wiiting a plugin of the filtei class. They aie the easiest
one, no inteiaction has to be manageu, no uialog has to be uesigneu, you have
only to uo the following steps:
think to youi plugin in teims of something taking a mesh anu some
paiameteis anu woiking on it.
uefine the iequiiements foi youi mesh (uo you neeu any kinu of
topology. colois. etc)
uefine the paiameteis using the stanuaiu methou of the filtei class
uefine the apply methou that uses the pioviueu paiameteis on a given
mesh.
Look at the sample in the sampleplugins uiiectoiy, at the 'samplefiltei' plugin
anu tiy to mouify it a bit. Remembei to change the name of the class you aie
ueiiving foi youi plugin when you stait with youi own plugin.

<F4
Foi committing back youi coue please follow CL0SELY the suggestions in the
Wiiting Coue page. 0bviously foi uoing that you neeu to be a iegisteieu NeshLab
Bevelopei on the souicefoige pioject.

G$&/ 0# FE3 %0' k
The vCu Lib coulu be uefineu as a libiaiy foi managing tiiangle meshes, but that
woulu be unfaii. vCu Lib is a libiaiy foi managing 4`3`E anu L-simplicial
complexes, which means Point Sets, Euge Nesh, Tiiangle Nesh anu Tetiaheuial
Neshes. To be completely honest, it is staiting to suppoit polygon meshes as well
(stay tuneu).
It just happens that the ieseaich inteiests of the uevelopeis leaueu to uevelop
mesh piocessing algoiithms mostly foi tiiangle meshes, but the keinel is theie
waiting... Bowevei, to avoiu annoying the ieauei with u-simplices, maximal
simplices anu so on, in this tutoiial we will always iefei to the case of tiiangle
meshes, extenuing the explanation to the othei cases only wheie appiopiiate.

VS"&#" .*/": this is not a iefeience manual, but a shoit tutoiial to guiue you
thiough the few basic concepts of vCu Lib. The iuea is that aftei ieauing this
tutoiial anu tiying the few examples in appssamples iefeiieu in the following,
you will have all it takes to wiite youi own coue.
41

2.#/&SS&/0*. &.N T*SN"M #/M,+/,M"

3"//0.O FE3 %0'
vCu Lib uses a SvN iepositoiy. To get the iight subset of the svn tiunk in the
uevel foluei you shoulu issue the following svn commanu:
svn co https:vcg.svn.souicefoige.netsvniootvcgtiunkvcglib vcglib
Winuows useis with toitoisesvn (http:www.toitoisesvn.net) installeu shoulu
1. cieate a foluei nameu U+OS0'. 2. iight-click in the newly cieateu vcglib foluei
anu choose SvN Checkout S. put in the fiist paiametei:
https:vcg.svn.souicefoige.netsvniootvcgtiunkvcglib 4. piess ok anu wait,
it shoulu stait to check out the last ievision of the whole tiee.

@*SN"M </M,+/,M"
@"$2 "/.$%+,K 98+C,/ #./:%.:/,
vCu Lib is mostly maue of heauei files (anu its coie pait it's 82+6 heauei files).
}ust uownloau the taiball fiom heie anu uncompiess it in a foluei, e.g. nameu
vcg, insiue you compilei "incluue" uiiectoiy. Afteiwaius, you will incluue the file
you neeu. Insiue vcg foluei you will finu 4 sub-folueis:
U+O: this is the coie of the libiaiy, wheie all the algoiithms anu uata
stiuctuies aie uefineu. This pait is puie, quite heavily templateu, C++
coue with STL suppoit foi common uata stiuctuies anu algoiithms. You
will not finu a single incluue fiom heie to anything else than stanuaiu
libiaiies. Note that coie pait is maue of heauei files (.h files) only.
PM&V: heie you will finu the wiapping of vCu concepts towaius specific
neeuscontextslibiaiies. Foi example you will finu all the coue to
impoitexpoit meshes fiom the haiu uisk in many foimats, oi the
ioutines foi ienueiing tiiangle meshes with 0penuL, suppoits foi
common u0I tools like a tiackball, anu so on..
&VV#: this foluei contains the commanu line applications uevelopeu with
the vCu Lib. Nany (much moie) examples can be founu in NeshLab. The
appssimple uiiectoiy contains a sub-collection of veiy basic apps. A goou
staiting point foi beginneis!
N*+#: uocumentation lives heie (incluuing this tutoiial)

K&#0+ E*.+"V/#

?*P /* N"T0." & -"#$ /[V"
The vCu Lib encoues a mesh as a set of veitices anu tiiangles (i.e. tiiangles foi
tiiangle meshes, tetiaheuia foi tetiaheuial meshes). The following line will be a
pait of the uefinition of a vCu type of mesh:
class NyNesh : public vcg::TiiNesh< stu::vectoi<Nyveitex>,
stu::vectoi<NyFace> > {}
vcg::TiiNesh is the base type foi a tiiangle mesh anu it is templateu on:
the type of STL %82."$2,/ containing the veitices
o which in tuin is templateu on youi U"M/"] /[V"
the type of STL %82."$2,/ containing the faces
o which in tuin is templateu on youi T&+" /[V"
42

The face anu the veitex type aie the ciucial bits to unueistanu in oiuei to be able
to take the best fiom vCu Lib. A veitex, an euge, a face anu a tetiaheuion aie just
an usei uefineu (possibly empty) collection of attiibute. Foi example you will
piobably expect Nyveitex to contain the (x,y,z) position of the veitex, but what
about the suiface noimal at the veitex... anu the coloi. vCu Lib gives you a
pietty elegant way to uefine whichevei attiibutes you want to stoie in each
veitex, face, oi euge.

Foi example, the following example shows thiee valiu uefinitions of Nyveitex :
#incluue <vcgsimplexveitexbase.h> #incluue
<vcgsimplexveitexcomponent.h> class NyFace; class NyEuge; class
Nyveitexu : public vcg::veitexSimp2<Nyveitexu, NyEuge, NyFace,
vcg::veitex::CooiuSu, vcg::veitex::NoimalSf> {}; class Nyveitex1 : public
vcg::veitexSimp2<Nyveitex1, NyEuge, NyFace, vcg::veitex::CooiuSu,
vcg::veitex::NoimalSf, vcg::veitex::Coloi4b> {}; class Nyveitex2 : public
vcg::veitexSimp2<Nyveitex2, NyEuge,NyFace> {};
vcg::veitexSimp2 is the vCu base class foi a veitex belonging to a 2-simplex. If
we weie to uefine a tetiaeuial mesh, foi example, we woulu have useu
vcg::veitexSimpS. The fiist S templates of vcg::veitexSimp2 must specify the
type of all the simplicies involveu in the mesh in ascenuing oiuei: the veitex type
itself, the type of euge anu the type of tiiangle (anu the type of tetiaheuion foi
the tetiaheuial meshes). It can be annoying when you see it but it is useful that
eveiy entity involveu knows the type of the otheis anu this is the way vCu Lib
uoes it. As you can see the thiee uefinitions of Nyveitex uiffei foi the iemaining
template paiameteis. These specify which attiibutes will be stoieu with the
veitex type: Nyveitexu is a type stoiing cooiuinates as a tiiple of uoubles anu
noimal as a tiiple of floats, Nyveitex1 also stoie a coloi value specifieu as 4
bytes anu Nyveitex2 uoes not stoie any attiibute, is an empty class.
vcg::CooiuSu, vcg::NoimalSf, vcg::Coloi4b anu many otheis aie implementeu in
vCu, theii complete list can be founu heie. You can place any combination of
them as a template paiameteis of youi veitex (youi simplex) type.

Now we have all it takes foi a woiking uefinition of NyNesh type:
* appssampletiimesh_basetiimesh_uefinition.h * #incluue <vectoi>
#incluue <vcgsimplexveitexbase.h> #incluue
<vcgsimplexveitexcomponent.h> #incluue <vcgsimplexfacebase.h>
#incluue <vcgsimplexfacecomponent.h> #incluue
<vcgcomplextiimeshbase.h> class NyEuge; class NyFace; class Nyveitex :
public vcg::veitexSimp2<Nyveitex, NyEuge, NyFace, vcg::veitex::CooiuSu,
vcg::veitex::NoimalSf> {}; class NyFace : public vcg::FaceSimp2<Nyveitex,
NyEuge, NyFace, vcg::face::veitexRef> {}; class NyNesh : public
vcg::tii::TiiNesh< stu::vectoi<Nyveitex>, stu::vectoi<NyFace> > {}; int main()
{ NyNesh m; ietuin u; }
0ne moie comment: vcg::veitexRef is an attiibute that stoies S pointeis to the
type of veitex, so implementing the Iuexeu Bata stiuctuie. This is an example of
why the type NyFace neeus to know the type Nyveitex

4S
.*/": Although we left the STL type of containei of veitices anu faces as a
template paiametei, at the cuiient state many keinel algoiithms of vCu Lib
assumes they aie STL vectoi, so if you pass a stu::list oi a map youi use of the
libiaiy will be quite limiteu.

?*P /* +M"&/" & -"#$
0nce you ueclaieu youi mesh type, you may want to instance an object anu to fill
it with veitexes anu tiiangles. It may cioss youi minu that you coulu just make
some push_back on the veitexes anu faces containei (uata membei veit anu face
of class vcg::tii::Tiimesh). In fact this is the wiong way since theie can be siue
effects by auuing element to a containei. We uesciibe this issue anu the coiiect
way of auuing mesh element in the Allocation page.

6$" TS&O# *T /$" -"#$ "S"-"./#
0sually to each element of the mesh we associate a small bit vectoi containing
useful single-bit infoimation about veitices anu faces. Foi example the ueletion
of veitex simply maik a the Beletion bit in thsi vectoi (moie uetails on the
vaiious ueletionallocation issues in the Allocation page. Noie uetails on the
vaiious kinu of flags that can be associateu aie in the Flags page.

?*P /* VM*+"## & -"#$
The algoiithms that C8 #8),.1$20 on a mesh aie geneially wiitten as static
membei functions of a class templateu on the mesh type. Foi example the coue
snippeu below is pait of the class 0puateNoimals, which contains the seveial
algoiithms to compute the value of the noimal
** vcgcomplextiimeshupuatenoimal.h * ... template <class
ComputeNeshType> class 0puateNoimals{ ... Calculates the veitex noimal (if
stoieu in the cuiient face type) static voiu PeiFace(ComputeNeshType &m)
Calculates the veitex noimal. Without exploiting oi touching face noimals
The noimal of a veitex v is the weigtheu aveiage of the noimals of the faces
inciuent on v. static voiu Peiveitex(ComputeNeshType &m) Calculates both
veitex anu face noimals. The noimal of a veitex v is the weigtheu aveiage of
the noimals of the faces inciuent on v. static voiu
PeiveitexPeiFace(ComputeNeshType &m) ... };
This class is pait of a keinel of classes with name 0puateR"+:, that compute the
value of the veitex oi face attiibutes anu that can be founu altogethei in the
foluei vcgcomplextiimeshupuate. Foi example, the following example show
how to compute the value of the noimal anu the mean anu gaussian cuivatuie
pei veitex:
* appssampletiimesh_basetiimesh_uefinition.h * #incluue <vectoi>
#incluue <vcgsimplexveitexbase.h> #incluue
<vcgsimplexveitexcomponent.h> #incluue <vcgsimplexfacebase.h>
#incluue <vcgsimplexfacecomponent.h> #incluue
<vcgcomplextiimeshbase.h> l0.+S,N"
fU+Oa+*-VS"]a/M0-"#$a,VN&/"a.*M-&S#7$g class 0puateNoimals
l0.+S,N" fU+Oa+*-VS"]a/M0-"#$a,VN&/"a+,MU&/,M"7$g class
0puateCuivatuie class NyEuge; class NyFace; class Nyveitex: public
vcg::veitexSimp2<Nyveitex,NyEuge,NyFace, vcg::veitex::CooiuSu,
U+O__U"M/"]__4*M-&SAT,U+O__U"M/"]__E,MU&/,M"T>{}; class NyFace: public
44
vcg::FaceSimp2<Nyveitex,NyEuge,NyFace, vcg::face::veitexRef>{}; class
NyNesh: public vcg::tii::TiiNesh< stu::vectoi<Nyveitex>, stu::vectoi<NyFace>
> {}; int main() { NyNesh m; fill the mesh ... compute the noimal pei-
veitex -> upuate the value of v.N() foiall v (vcg::veitex::NoimalSf)
vcg::tii::0puateNoimals<NyNesh>::C"MF"M/"]C"M@&+"(m); compute the
cuivatuie pei-veitex -> upuate the value of v.B() anu v.K()
(vcg::veitex::Cuivatuief)
vcg::tii::0puateCuivatuie<NyNesh>::!"&.1.N3&,##0&.(m); ietuin u; }
0thei than algoiithms that upuate values of the mesh attiibutes, vCu Lib
pioviues algoiithms to cieate a mesh fiom anothei souice, foi example fiom
point sets (by means of the Ball Pivoting appiach) oi as isosuifaces fiom a
volumetiic uataset (by means of Naiching Cubes algoiithm). Those algoiithm
can be founu in vcgcomplextiimeshcieate.

Finally, you can finu algoiithms foi iefinement (miupoint, Loop, Butteifly...), foi
smoothing, foi closing holes anu othei that aie not cuiiently classifieu unuei any
specific heauing anu that you can finu unuei vcgcomplextiimesh.

:V/0*.&S E*-V*."./
Theie aie many cases wheie some veitex oi face attiibutes aie not necessaiy all
the time. vCu Lib gives you a way to specify 8*.$82"+ %8)*82,2.#, i.e. attiibutes
that aie not statically stoieu within the simplex but can be uynamically allocateu
when you neeu them. We use the teim %8)*82,2. to inuicate that they aie pait
of the simplex type anu that theie is a membei function to access theii value.
To 'uefine' optional component you neeu to uo two things:
to use a special type of containei (ueiiveu fiom stu::vectoi)
to specify the iight type of component in the template paiameteis
An optional component can be accesseu when the memoiy foi it has been
allocateu, in which case we say that the component is 'enableu'. An optional
component can be enable by calling the function Enable.
vCu Lib hanules optional components with two alteinative mechanisms: the fiist
is calleu '0cf' (foi 0ptional Component Fast) which uses one pointei foi each
simplex but it makes accessing optional attiibute almost as fast as non-optional
ones; the seconu is calleu '0cc' (foi 0ptional Component Compact) which only
iequiies a little extia space foi each mesh (unielateu to its size in teims of
numbei of simplicies) but which can iesult in a slowei access. In the following,
only theii use is uiscusseu. The implementation uetail can be founu heie.

:V/0*.&S E*-V*."./ @&#/
The following uefinition of NyNesh specifies that the 'noimal' component of the
type Nyveitex is optional. The uiffeiences fiom the pievious example aie shown
in bolu.
incluue the heauei foi the optional_component_ocf.h which contains the
uefinitions foi the optional attiibutes;
incluue the special attiibute <vcg::veitex::Info> as fiist attiibute of the
type vcg::veitex::veitexSimp2;
use the type vcg::vectoi_ocf as the containei of youi veitices;
incluue the type U+O__U"M/"]__4*M-&SAT:+T among the template
paiameteis
4S
* check appssampletiimesh_optionaltiimesh_optional.cpp * #incluue
<vectoi> #incluue <vcgsimplexveitexbase.h> l0.+S,N"
fU+Oa#0-VS"]aU"M/"]a+*-V*."./m*+T7$g #incluue
<vcgsimplexfacebase.h> #incluue <vcgsimplexfacecomponent.h>
#incluue <vcgcomplextiimeshbase.h> class NyEuge; class NyFace; class
Nyveitex: public
vcg::veitexSimp2<Nyveitex,NyEuge,NyFace,U+O__U"M/"]__2.T*:+T,vcg::veitex::C
ooiuSu, U+O__U"M/"]__4*M-&SAT:+T>{}; class NyFace: public
vcg::FaceSimp2<Nyveitex,NyEuge,NyFace,vcg::face::veitexRef>{}; class
NyNesh: public vcg::tii::TiiNesh<U+O__U"M/"]__U"+/*Mm*+Tf![F"M/"]g,
stu::vectoi<NyFace> >{}; int main() { NyNesh m; ...fill the mesh...
NyNesh::veitexIteiatoi vi = m.veit.begin(); (*vi).N() =
vcg::PointSf(1.u,1.u,1.u); ERR0R -7U"M/75.&'S"4*M-&Sde; this allocate
the memoiy to stoie the noimal (*vi).N() = vcg::PointSf(1.u,1.u,1.u); 0K
-7U"M/7)0#&'S"4*M-&Sde; this ueallocate the memoiy to stoie the noimal
(*vi).N() = vcg::PointSf(1.u,1.u,1.u); ERR0R (again)! ietuin u; }
Befoie accessing the uata containeu in the 28/)"+ component, you must enable
the attiibute by calling EnableNoimal(), afteiwaius the space foi the component
will be allocateu anu accessible until you call BisableNoimal(). Tiying to access
the value of the noimal befoie enabling oi aftei uisabling the coiiesponuing
component will thiow an asseition.

:V/0*.&S E*-V*."./ E*-V&+/
The following uefinition of NyNesh specifies that the 'noimal' attiibute of the
type Nyveitex is optional. To use a 0cc component you must:
incluue #incluue <vcgsimplexveitexcomponent_occ.h;
use the type vcg::vectoi_occ as the containei of youi veitices.
specify the attiibute noimal as optional by passing
U+O__U"M/"]__4*M-&SAT:++ among template paiameteis of veitexSimp2.
* check appssampletiimesh_optionaltiimesh_optional.cpp * #incluue
<vectoi> #incluue <vcgsimplexveitexbase.h> l0.+S,N"
fU+Oa#0-VS"]aU"M/"]a+*-V*."./m*++7$g #incluue
<vcgsimplexfacebase.h> #incluue <vcgsimplexfacecomponent.h>
#incluue <vcgcomplextiimeshbase.h> class NyEuge; class NyFace; class
Nyveitex: public vcg::veitexSimp2<Nyveitex,NyEuge,NyFace,
vcg::veitex::CooiuSu, U+O__U"M/"]__4*M-&SAT:++>{}; class NyFace: public
vcg::FaceSimp2<Nyveitex,NyEuge,NyFace,vcg::face::veitexRef>{}; class
NyNesh: public vcg::tii::TiiNesh< U+O__U"M/"]__U"+/*Mm*++f![F"M/"]g,
stu::vectoi<NyFace> >{}; int main() { NyNesh m; ...fill the mesh...
NyNesh::veitexIteiatoi vi = m.veit.begin(); (*vi).N() =
vcg::PointSf(1.u,1.u,1.u); ERR0R
-7U"M/75.&'S"fU+O__U"M/"]__4*M-&S6[V"gde; this allocate the memoiy to
stoie the noimal (*vi).N() = vcg::PointSf(1.u,1.u,1.u); 0K
-7U"M/7)0#&'S"fU+O__U"M/"]__4*M-&S6[V"gde; this ueallocate the memoiy to
stoie the noimal (*vi).N() = vcg::PointSf(1.u,1.u,1.u); ERR0R (again)!
ietuin u; }

Befoie accessing the uata containeu in the noimal, you must enable the attiibute
by calling EnableAttiibute<vcg::veitex::NoimalSf0cc::NoimalType>(),
46
afteiwaius the attiibute will be allocateu anu accessible until you call
BisableAttiibute<vcg::veitex::NoimalSf0cc::NoimalType>(). Tiying to access the
value of the noimal befoie enabling oi aftei uisabling the coiiesponuing
attiibute will thiow an asseition.
Two impoitant things about optional optional components:
The access function to the value of a component is the same both if the
component is optional anu if it's not. This means that you uo not have to
make this uistinction when couing youi algoiithm
If you make a copy of the veitex(face) anu then tiy to access a component
it won't woik. The mechanisms foi optional attiibutes woiks using the
position of the veitex(face) in memoiy. In othei woius, the optional uata
is associateu with a position of the containei ( vectoi_ocf oi vectoi_occ)
anu not bounu to the veitex itself.

9#"M`N"T0."N &//M0',/"#
vCu Lib also pioviues a simple mechanism to associate usei-uefineu 'attiibutes'
to the simplicies anu to the mesh. Note that both 'attiibutes' anu 'components'
aie basically accessoiy uata that aie bounu to a simplex. Conceptually the
uiffeience is that with the teim component vCuLib inuicates those values that
aie consiueieu to 'uefine' the simplex (its position, its noimal its connectivity
infoimation), while the usei uefineu attiibute is an accessoiy uata which make
sense to some specific algoiithm, like "the numbei of time a veitex has been
moveu" oi "a pointei to a stiing containing a uesciiption of the veitex".
Piactically the uiffeience is that eveiy optional component has its non optional
counteipait anu is accesseu thiough a membei function of the simplex, so that
when you wiite youi algoiithm you use v.N() to access the noimal both it is has
been ueclaieu as optional oi not, while the attiibutes aie accesseu by a hanule
which is ietuineu at the cieation of the attiibute.

The following coue snippet shows an example:
* appssampletiimesh_attiibutetiimesh_attiibute.cpp *
#incluue<vcgsimplexveitexbase.h>
#incluue<vcgsimplexveitexcomponent.h>
#incluue<vcgsimplexfacebase.h> #incluue<vcgsimplexfacecomponent.h>
#incluue<vcgcomplextiimeshbase.h>
#incluue<vcgcomplextiimeshallocate.h> class NyFace; class Nyveitex; class
NyEuge; uummy piototype nevei useu class Nyveitex : public
vcg::veitexSimp2< Nyveitex, NyEuge, NyFace,
vcg::veitex::CooiuSf,vcg::veitex::NoimalSf>{}; class NyFace : public
vcg::FaceSimp2< Nyveitex, NyEuge, NyFace, vcg::face::veitexRef,
vcg::face::NoimalSf> {}; class NyNesh : public vcg::tii::TiiNesh<
stu::vectoi<Nyveitex>, stu::vectoi<NyFace> > {}; float
Iiiauiance(NyNesh::veitexType v){ ..... ietuin 1.u; } int main() {
NyNesh m; ...heie m is filleu auu a pei-veitex attiibute with type float
nameu "Iiiauiance" NyNesh::PeiveitexAttiibuteBanule<float> ih =
vcg::tii::Allocatoi<NyNesh>::AuuPeiveitexAttiibute<float>
(m,stu::stiing("Iiiauiance")); auu a pei-veitex attiibute with type float
nameu "Rauiosity"
vcg::tii::Allocatoi<NyNesh>::AuuPeiveitexAttiibute<float>
47
(m,stu::stiing("Rauiosity")); auu a pei-veitex attiibute with type bool anu
no name specifieu NyNesh::PeiveitexAttiibuteBanule<bool> blockeu_h =
vcg::tii::Allocatoi<NyNesh>::AuuPeiveitexAttiibute<bool> (m);
NyNesh::veitexIteiatoi vi; int i = u; foi(vi = m.veit.begin(); vi != m.veit.enu();
++vi,++i){ ih|vij = Iiiauiance(*vi); |j opeiatoi takes a iteiatoi ih|*vij =
Iiiauiance(*vi); oi a NyNesh::veitexType object ih|&*vij= Iiiauiance(*vi);
oi a pointei to it ih|ij = Iiiauiance(*vi); oi an integei inuex }
0nce cieateu with AuuPeiveitexAttiibute, an hanule to the attiibute can be
obtaineu as follows NyNesh::PeiveitexAttiibuteBanule<float> ih =
vcg::tii::Allocatoi<NyNesh>::uetPeiveitexAttiibute<float>(m,"Rauiosity");
you can queiy if an attiibute is piesent oi not bool hasRauiosity =
vcg::tii::BasPeiveitexAttiibute(m,"Rauiosity"); you can uelete an attibute
by name
vcg::tii::Allocatoi<NyNesh>::BeletePeiveitexAttiibute<float>(m,"Rauiosity");
you can uelete an attibute by hanule
vcg::tii::Allocatoi<NyNesh>::BeletePeiveitexAttiibute<bool>(m,blockeu_h); }

The same can be uone foi the faces, just ieplace the occuiiences of Peiveitex
with PeiFace. Note that if you call auu an attiibute H$.18:. specifying a name anu
you lose the hanule, you will not be able to get youi hanule back.

Note:
Bo not get mix up the scope of the hanule with the memoiy allocation of
the attiibute. If you uo not uelete an attiibute explicitly, it will be
allocateu until the mesh itself is uestioyeu, even if you uo not have
hanules to it.

EWW /[V" *T & -"#$ &.N M"TS"+/0*.
vCu Lib pioviues a set of functions to implement ieflection, i.e. to investigate the
type of a mesh at iuntime. These functions follow the foimat
Bas|attiibutej(mesh) anu ietuin a boolean stating if that paiticulai attiibute is
piesent oi not.
template<class ComputeNeshType> static voiu
0puateNoimals<ComputeNeshType>::Peiveitex(ComputeNeshType &m) {
if( !BasPeiveitexNoimal(m)) ietuin; ... }
You may wonuei why those functions aie not statically typeu anu why they
neeus the mesh object, i.e. why can't you just wiite
ComputeNeshType::BasPeiveitexNoimal(). The ieason is that vCu Lib
ieflection takes into account optional components, theiefoie
BasPeiveitexNoimal(m) will ietuin tiue if the type of the veitex contains the
attiibute as peimanent (e.g. vcg::veitex::NoimalSf) 0R if it contains the attiibute
as optional (e.g. vcg::veitex::NoimalSf0cf) ANB it is enableu, i.e. the ielative
Enable function has been calleu.

1Nn&+".+[
vCu Lib uoes not have a haiu-coueu way to encoue the aujacencies among
simplices. It all uepenus on which attiibutes aie stoieu with the simplices anu
how they aie useu. I the pievious examples the uefinition of face has always
incluueu the attiibute vcg::face::veitexRef , which stoies S pointeis to Nyveitex
48
accessible with the membei function v() (the well known Inuexeu Bata
Stiuctuie). The ieason is that almost all of the algoiithms cuiiently implementeu
in vCu Lib assume its piesence. So, if youi type NyFace uoes not incluue the
attiibute vcg::face::veitexRef, the uefinition will be coiiect but almost no
algoiithm will woik. Theie aie othei aujacency ielations that can be useful to
2"G$0"., a mesh, foi example to collect the one-iing neighboihoou of a veitex.
vCu Lib uses two mechanisms which aie explaineu in the following, along with
the attiibutes they use.

@@ 1Nn&+".+[
The face-to-face aujacency, stoieu in the attiibute foi the faces vcg::face::FFAuj (
vcg::face::TTAuj foi tetiaheuia), encoues the aujacency of faces (tetiaheuia)
thiough euges (faces). The image below shows two tiiangle faces with the
convention auopteu foi inuexing veitexes anu euges.
The veitexes aie numbeieu fiom 4 to E in CCW sense anu the euge $ g 4&&E is the
euge whose extiemes aie $ anu \$X3] )8C L . Theiefoie the common euge
between faces D
3
anu D
E
is the euge 3 of the face D
3
anu the euge 4 of the face D
4
.
vcg::face::FFAuj stoies, foi each euge , of the face D:
FFp(e): a pointei to & face Dh shaiing ,. If , is a boiuei than points to the
face D itself
FFi(e):the inuex of , in the pointeu face


Inuexing of veitexes anu euges
f1->FFp(1) == fu
f1->FFi(1) == u
fu->FFp(u) == f1
fu->FFi(u) == 1
Note that we specifieu that FFp(e) point to & aujacent face, not to /$" aujacent
face. The ieason is that theie coulu be moie than two faces on the same euge,
anu this is seamlessly suppoiteu by vCu Lib. In the pictuie below is shown an
example with M faces inciuent to the same euge

Non manifolu euge
49
In this case the aujacencies aie set to foim a ciiculai list (not necessaiily soiteu
with the angle aiounu the euge). This is uone by the vCu Lib function that upuate
these values (0puateTopology<NeshType>::FFTopology(NeshType & m)).
In this way vCu Lib pioviues a way to check if a mesh is manifolu on a specific
euge because the FF aujacency ielation is -,/,&S, i.e. the face D
4
points to the
face D
3
which points to the face D
4
, if anu only if the mesh is manifolu ovei the
coiiesponuing euge.
bool IsNanifolu(NyFace *f,int e) { ietuin (f == f->FFp(e)->FFp(f->FFi(e)))}
Refeiiing to the pictuie:
(fu == fu->FFp(u)->FFp(fu->FFi(u))} equals
(fu == f1->FFp(u)} equals
(fu == fu} 0k! It is manifolu

7"8
The Pos is the vCu Lib implementation of the Cell-Tuple{ief}. Beie we give a as
shoit as possible uefinition, tiauing foimalisms foi space. A Pos in a tiiangle
mesh is a tiiple maue of a veitex: *8# g \G`,`D] , such that G is an extieme of , anu ,
belong to the face D . The figuie shows few pos in a tiiangle mesh as small
tiiangles "pointing" to a veitex, "leaning" against an euge anu insiue a face. Foi
example %4g\G`,4`D].
A veiy nice piopeity is that given a pos %, theie is only anothei 2,$01N8/ pos %h
that can be obtaineu fiom % changing only one of the elements of the tiiple.
We call the opeiation of passing fiom a pos to one of its neighbois 9+$* anu wiite
@S0VF, @S0V5 anu @S0V@ to inuicate that the D+$**,C element is the veitex, the euge
oi the face iespectively.
Foi example consiuei %3: theie is only anothei pos which is the same as %4
except foi the veitex component of the tiiple, anu it is %E. Foi bievity, we wiite
%E g 9+$*R\%3].
In the left of the table some othei examples aie shown just to make this point
cleai.


c2 = FlipF(c1)
cu = Flip5(c1)
cS = Flip@(cu)

EEG &M*,.N U
c4 = Flip5(Flip@(cu))
cS = Flip5(Flip@(c4))
K*,.+"
c6 = Flip5(Flip@(cS))
EG &M*,.N U
cS = Flip5(Flip@(c6))
c1 = Flip5(Flip@(cS))
K*,.+"
cu = Flip5(Flip@(c1))

Su
Note that concatenating two flips: FlipF anu FlipE we obtain a tiansition fiom a
pos to the next in counteiclockwise oi in clockwise sense, uepenuing if the
staiting pos is on the CCW euge of the face with iespect to the veitex oi not. Also
note that, thanks to how FF aujacency is uefineu, when a pos is on the boiuei, it
N8:2%,# back. This paii of flips aie wiuely useu in the vCu Lib to iun ovei the one
iing neighboihoou of manifolu veitices.

The following coue snippet shows how to use the pos to iteiate aiounu a veitex:
* vcglibappssampletiimesh_pos_uemotiimesh_pos_uemo.cpp * #incluue
<vcgsimplexfacepos.h> incluue the uefinition of pos ...incluues to uefine
youi mesh type class Nyveitex: ... class NyFace: public
vcg::FaceSimp2<Nyveitex,NyEuge,NyFace,
vcg::face::veitexRef, U+O__T&+"__@@1Nn>{}; voiu 0neRingNeighboihoou( NyFace *
f) { Nyveitex * v = f->v(u); NyFace* stait = f; vcg::face::Pos<NyFace>
p(f,u,v); constiuctoi that takes face, euge anu veitex uo { p.FlipF();
p.FlipE(); }while(p.f!=stait); }

Two impoitant notes:
We aibitiaiily pickeu f->v(u) as pivot veitex. In geneial one may want to
stait knowing the veitex. This is uone by incluuing the attiibute
vcg::veitex::vFAuj which basically associates to each veitex pointei to
one of the faces inciuent on it. See the vF Aujacency foi uetails.
This implementation uoes not woik if the veitex is on the boiuei. }ust tiy
with the example: fiom the pos %M it woulu finu %O,%W,%L which is in the
same face as %M. 0f couise this uoes not happen if you use the pos itself as
a guaiu anu not just the face. Bowevei, even in this case, you woulu
obtain the sequence of pos: %O,%W,%L,%3,%4,%M coiiesponuing to the faces
DE,DE,D3,D4,D4,D3 which piobably is not what you want. vCu Lib pioviues a
vaiiation of pos that solves this pioblem

X<-.3'4 7"8
The }umping Pos woiks exactly like the Pos, only it uoes not bounce when it
encounteis the boiuei. Insteau, it jumps "/8:2C the shaieu veitex of the boiuei-
faces as if they weie aujacent (faces D4 anu DE in the image).
* vcglibappssampletiimesh_pos_uemotiimesh_pos_uemo.cpp * #incluue
<vcgsimplexfacejumping_pos.h> incluue the uefinition of jumping pos
...incluues to uefine youi mesh type class Nyveitex: ... class NyFace: public
vcg::FaceSimp2<Nyveitex,NyEuge,NyFace,
vcg::face::veitexRef,vcg::face::FFAuj>{}; voiu 0neRingNeighboihoou}P( NyFace
* f) { Nyveitex * v = f->v(u); NyFace* stait = f; vcg::face::}umpingPos<NyFace>
p(f,u,v); constiuctoi that takes face, euge anu veitex uo { p.NextFE();
}while(p.f!=stait); }

F@ 1Nn&+".+[
vCu Lib implements veitex-to-face aujacency, i.e. given a veitex G we can ietiieve
all the faces inciuent to G. Let Ge#."/ g\D4`D3`DE`&&&`DB] be the set faces inciuent to G
aiiangeu in a sequence (with no piefeiieu ciiteiia). vCu Lib allows to ietiieve
Ge#."/ in optimal time ( 9\i#."/eG) by using the following attiibutes:
vcg::veitex::vFAuj which is a veitex attiibute containing a pointei to D4
S1
vcg::face::vFAuj which is a face attiibute containing a pointei to the next
face in the list Ge#."/ foi each of its S veitices (4 in the case of tetiaheuia)

These two attiibutes aie not only pointeis, they also contain an inuex iefeiiing
the inuex of the veitex in the pointeu face in the same style as the
vcg::face::FFAuj uoes. The pictuie below shows a complete example:



example of veitex-face aujacency
v.vFp()==f2
v.vFi() == u
f2->vFp(u)==fS
f2->vFi(u) == 1
fS->vFp(1)==f1
fS->vFi(1) == 2
f1->vFp(2)==fu
f1->vFi(2) == 2
fu->vFp(2)==N0LL
fu->vFi(2) == -1

A;P#$()#"(
vFIteiatoi is a simple iteiatoi to iun ovei the faces in the one-iing neighboihoou
of a veitex using the vF Aujacency (it is just like Pos foi the FF Aujacency) The
following coue snippet shows how to use the vFIteiatoi:
* vcglibappssampletiimesh_pos_uemotiimesh_vfitei_uemo.cpp *
#incluue <vcgsimplexfacepos.h> incluue the uefinition of vFIteiatoi
...incluues to uefine youi mesh type class Nyveitex: public
vcg::veitexSimp2<Nyveitex,NyEuge,NyFace, U+O__U"M/"]__F@1Nn *,... othei
attiibutes* >{}; class NyFace: public
vcg::FaceSimp2<Nyveitex,NyEuge,NyFace,
vcg::face::veitexRef,U+O__T&+"__F@1N>{}; voiu 0neRingNeighboihoouvF(
Nyveitex * v) { vcg::face::vFIteiatoi<NyFace> vfi(v); initialize the iteiatoi
tohe fiist face foi(;!vfi.Enu();++vfi) { NyFace* f = vfi.F(); ...uo something
with face f } }

@"P T&+/# *. @@ &Nn&+".+[ &.N F@ &Nn&+".+[
Beie we make a seiies of simple statements just to avoiu confusion anu tiy to
help up choosing the aujacencies the best fit youi neeus.
If the mesh is manifolu, the one-iing neighboihoou of a veitex computeu
by using Pos ( neeus FF aujacency) is the same as the one computeu by
using vFIteiatoi (neeus vF aujacency). The oiuei in which the faces aie
visiteu can be CW oi CCW if using Pos, unspecifieu by using vFIteiatoi
S2
If the mesh is non-manifolu, Pos may not finu all the faces of the one-iing
neighboihoou of the veitex, vFIteiatoi always uoes

K*,.N&M[ M"S&/0*.# &.N &Nn&+".+[
In many algoiithms you neeu to simply the bounuaiyboiuei conuition of a face,
e.g. to know if a given face f has one oi moie aujacent faces on a specifieu euge e.
0sing FF aujacency this can be uone simply by using the face::IsBoiuei(f,e) static
function that simply checks if the pointei stoieu in face f on the euge e points to f
itself. If you aie navigating the mesh using a Pos, you have a Pos membei
function IsBoiuei() that iepoits the bounuaiy conuition of the cuiient pos.
Similaily, foi testing manifoluness of specific places ovei a mesh, theie is a
face::IsNanifolu(f,e) static function anu a IsNanifolu(e) function membei of the
pos class.

If you aie not using FF aujacency evaluating the bounuaiy conuitions coulu be
not veiy efficient, so vcg libiaiy pioviues a technique to %88B the cuiient
bounuaiy conuitions of the mesh into veitex anu face flags. 0se the membeis of
the 0puateFlags static class to compute flags that ieflects the cuiient mesh
status anu the access these flags using the IsB(e) membei function of the face
class. Remembei that flags baseu bounuaiy infoimation can become invaliu if
you change the mesh topology. 0n the othei hanu consiuei that many non-mesh-
mouifying algoiithms uo not iequiie explicit FF aujacency but just bounuaiy
infoimation (typical examples: most mesh smoothing anu cuivatuie
computation algoiithms).

Please note that the bounuaiy flags aie set tiue also foi non manifolu conuitions.

<V&+" +*.+"V/#
vCu Lib implements the basic functionalities to hanule geometiic entities such as
the point, the segment, the tiiangle anu so on. It is veiy impoitant not to confuse
those geometiic entities anu the topological entities they can be a component of.
In othei woius, the type vcg::PointSf (vcgspacepointS.h) is a point in S
uimensional space anu is uiffeient fiom a veitex (vcg::veitexSimp2<...>) which is
a topological entity. The same goes foi the vcg::SegmentS anu the
vcg::EugeSimp2<..>, the vcg::TiiangleS anu the vcg::FaceSimp2.

F0"P0.O &.N -&.0V,S&/0*.
In this section, all that conceins the uefinition of a view anu the manipulation of
a mesh will be explaineu.

<$*/ &.N +&-"M&
This section piesents the stiuctuie of the shot anu cameia of the libiaiy. Aftei an
oveiview of the cameia mouel useu, all the components of the shot class aie
listeu anu uesciibeu. Then, a set of examples of the most impoitant opeiations
(piojection anu un-piojection) anu of the inteiactions between shots anu
between a shot anu the tiackball aie piesenteu. Finally, simple examples of a
shot aie visually shown, in oiuei to help with the implementations of eventual
wiappeu to anu fiom othei shot-cameia foimats.

SS
6$" +&-"M& -*N"S
In geneial, the cameia paiameteis can be uiviueu in two gioups:
5]/M0.#0+ d*M "]/"M.&Se V&M&-"/"M#: these aie the paiameteis
associateu to the position in the space of the cameia.
2./M0.#0+ d*M 0./"M.&Se V&M&-"/"M#: these values aie ielateu to the
peculiai chaiacteiistics of the cameia, like the focal length (the _88)) oi
the uistoition intiouuceu by the lenses.

If these gioups of values aie put in a piopei cameia mouel, it is possible to
tiansfoim any point in the space in the coiiesponuing point on the image plane
of the cameia (anu G$%, G,/#").



An example scheme of a peispective cameia mouel

In fact, given a simple peispective cameia mouel like the one shown in figuie,
extiinsic paiameteis can be useu to tiansfoim a point fiom its woilu cooiuinates
{x
w
,y
w
,z
w
} to the cameia SB cooiuinate system {x,y,z}):


In this case the extiinsic paiameteis aie a S X S iotation matiix R anu a
tianslation vectoi T, which uefine the 8/$,2.".$82 anu *8#$.$82 of the cameia. In
oiuei to tiansfoim the SB cameia cooiuinate in 2B image plane cooiuinates
(X
u
,Y
u
) it's necessaiy to know the measuie of the uistance between the point of
view anu the image plane (00
1
in figuie): this value, inuicateu with D, is usually
known as the D8%"+ +,20.1. The ielation between the cameia anu image
cooiuinates of the point can be expiesseu as follows:

S4
Anothei aspect of the stiuctuie of a cameia that can be chaiacteiizeu is the
uistoition intiouuceu by the lenses: if we suppose that the uistoition is iauial
(peifoimeu along the iauial uiiection iespect to the centei of uistoition) we can
calculate the unuistoiteu image cooiuinates

wheie

anu

In conclusion, a quite accuiate mouel of a cameia can be uesciibeu by:
A SxS iotation matiix anu a tianslation vectoi foi extiinsic paiameteis
The values of focal, centei of uistoition anu one oi moie uistoition
coefficients foi intiinsic paiameteis
While this set of paiameteis pioviues eveiything to tiansfoim any SB point in its
coiiesponuing point in the image plane, this coulu be not enough in peculiai
applications. If an accuiate estimation of the ieal position of the cameia iespect
to the object is neeueu, some moie uata about the cameia mouel aie neeueu: in
paiticulai, the sensoi physical size togethei with the iesolution in pixel of the
acquiieu image. If these a-piioii uata aie known, a unique set of cameia
paiameteis is associateu to any shot.

6$" FE3 <$*/
The implementation of a Shot in the vCu libiaiy can be founu in vcg\math\shot.h
The shot is composeu by two elements:
the Extiinsics paiameteis, which aie stoieu in the class Shot (in the type
RefeienceFiame) that contains viewpoint anu view uiiection.

The Extiinsics paiameteis aie kept as a iotation matiix "iot" anu a tianslation
vectoi "tia" N0TE: the tianslation matiix "tia" coiiesponus to -viewpoint while
the iotation matiix "iot" coiiesponus to the axis of the iefeience fiame by iow,
i.e.
iot|uj|u 1 2j == X axis
iot|1j|u 1 2j == Y axis
iot|2j|u 1 2j == Z axis

It follows that the matiix maue with the uppei left SxS equal to iot anu the 4th
column equal to tia anu (u,u,u,1) in the bottom iow tiansfoim a point fiom
woilu cooiuinates to the iefeience fiame of the shot.
the Instiinsics paiameteis, which aie stoieu as a Cameia type (check
vcgmathcameia) anu that ueteimines how a point in the fiame of the
cameia is piojecteu in the 2B piojection plane. This infoimation was kept
inuenuent of the extiinsic paiameteis because moie than one shot can
shaie the same intiinsic paiameteis set.

SS
The attiibutes of a Cameia, which is uefine in vcg\math\shot.h, aie:

------ cameia intiinsics ScalaiType FocalNm; Focal
Bistance: the uistance between focal centei anu image plane. Expiesseu in mm
Point2<int> viewpoitPx; Bimension of the Image Plane
(in pixels) Point2< S> PixelSizeNm; Bimension in mm of a
single pixel Point2< S> CenteiPx; Position of the
piojection of the focal centei on the image plane. Expiesseu in pixels Point2< S>
BistoiCenteiPx; Position of the iauial uistoition centei on
the image plane in pixels S k|4j; 1st & 2nu
oiuei iauial lens uistoition coefficient (only the fiist 2 teims aie useu) ----------
--------------
While the extiinsic paiameteis usually change between the shots, some
(sometimes all) of the intiinsic aie stiongly ielateu to the cameia mouel useu. In
paiticulai, some values aie usually known befoie cameia calibiation:
viewpoitPx anu CenteiPx. Noieovei, if an accuiate calibiation is neeueu, it is
necessaiy to fill the PixelSizeNm value. This can be infeiieu fiom the cameia
uatasheet (it can be calculateu by uiviuing the sensoi wiuth anu height, in mm,
by the iesolution of the image) oi, in some cases, fiom the EXIF of the image (in
the CAN0N mouels, it is the inveise of FocalPlane X-iesolution anu FocalPlane Y-
iesolution, scaleu fiom inches to mm if necessaiy). If a coiiect PixelSizeNm is
not set, the values of the cameia paiameteis can be uiffeient fiom the ieal ones,
even though the image is peifectly aligneu to a SB mouel. Also the focal uistance
can be infeiieu fiom EXIF, but its value is inuicative. If a calibiateu cameia is
useu, then all the intiinsic paiameteis shoulu be known in auvance.

@0S" @*M-&/#
vCuLib pioviues impoitei anu expoitei foi seveial file foimats
impoit: PLY, STL, 0FF, 0B}, SBS, C0LLABA, PTX, vSB, PTS, APTS, XYZ,
uTS, TRI, ASC, XSB, XSBv, vRNL, ALN
expoit: PLY, STL, 0FF, 0B}, SBS, C0LLABA, vRNL, BXF, uTS, 0SB, IBTF,
XSB
The following coue snippet show how to use the PLY impoitei anu expoitei:
#incluue <wiapio_tiimeshimpoit.h> uefinition of type NyNesh NyNesh m;
vcg::tii::io::ImpoiteiPLY<NyNesh>::0pen(m,"namefile_to_open.ply"); ....
vcg::tii::io::ExpoiteiPLY<NyNesh>::Save(m,"namefile_to_save.ply");
The pievious one is the minimal iequiieu inteiface foi all the impoitei anu
expoiteis. Auuitionally two othei paiameteis can be specifieu: mask anu
callback . The callback is useu foi pioviuing a feeuback uuiing the usually lenght
impoitingexpoiting piocess. The mask is useu to bettei specifyunueistanu
what is loaueusaveu.

<&U0.O !&#X &.N ;"&N0.O !&#X
ueneially all file foimats save at least veitex positions anu basic connectivty
infoimation, but beyonu that you may want to choose which othei uata aie
stoieu with the file. To this aim, vCuLib pioviues a class vcg::tii::io::Nask which
is essentially a collection of bit names that aie useu to specify which components
you want to wiite to the file (e.g. stuff like vcg::tii::io::Nask::I0N_vERTC0L0R).
S6
When #&U0.O this mask is useu in a j[?; IF5k moue (they aie just constants) to
specify what component you want to save. Foi example, if you have stoieu in
youi mesh noimals pei veitex (foi ienueiing puiposes) but you consiuei saving
them in ply foimat just a waste of space, you shoulu specify an appiopiiate mask
with the Nask::I0N_vERTN0RNAL bit cleaieu. 0bviously not all the foimats aie
able to save all the possible uata. Foi example STL foimat cannot save textuie
cooius oi pei veitex coloi. So to know what you aie able to save in a given XXX
foimat theie is the function ExpoiteiXXX::uetExpoitNaskCapability() that gives
you a bitmask with all the capability of that file foimat.

When S*&N0.O this mask is useu in a =j^Q[ IF5k moue to iepoit to the usei
what fielus have been loaueu fiom the file into the mesh (e.g. the initial value of
the mask is ignoieu). In many cases it coulu be useful to know what uata is
piesent into a file to */,*"/, the mesh (e.g. to enable optional components), foi
this puipose all the impoitei have also a
ImpoiteiXXX::LoauNask(filename,mask) that fill the mask only without
effectively loauing a mesh. Note that foi some mesh foimats unueistanuing what
is containeu into a file means paising the whole file.

5MM*M ;"V*M/0.O
The mesh I0 functions ietuins ZER0 on success anu an eiioi coue uiffeient
fiom zeio in case of failuie oi ciitical conuitions. 0se the static const chai
*EiioiNsg(int eiioi) function to get a human unueistanuable uesciiption of the
eiioi coue anu static bool EiioiCiitical(int eii) to know if a given eiioi is a
ciitical one oi just a waining. Foi example in the 0B} foimat the absence of the
accompanying mateiial uesciiption file, is consiueieu non ciitical (you aie able
to get the coiiect geometiy even if you miss mateiial info).

F!2 N,-V T0S"
vNI is an acionym foi Fcglib !esh 2mage anu it is .*/ a piopei file foimat but a
simple uump of the vcg: TiiNesh on a file. Not being a file foimat means that:
theie is no specification
it is bounu to the cuiient veision of the vCuLib with no backwaiu
compatibility
a vNI can be veiy useful foi uebug puipose, because it saves:
all the components
all the tempoiaiy components (cuiiently only of 0ptional Component
Fast type)
all the veitex, face oi mesh attiibutes you have in youi mesh file
So if, foi example, youi algoiithm ciashes at the n-th step, you can save
inteimeuiate iesults of youi computation with vNI anu ieloau it.
Note that in oiuei to loau a vNI the mesh passeu as template to
vcg::tii::ImpoiteivNI<NeshType>(..) must be of the same type as the mesh
passeu to vcg::tii::ExpoiteivNI<NeshType>(..) otheiwise the loauei ietuins
FALSE.




S7
1++"## /* -"#$

Assumption: the mesh is stoieu in a object m of type NyNesh

1++"##0.O /$" +**MN# *T &SS /$" U"M/"]"#
NyNesh::veitexIteiatoi vi; foi(vi = m.veit.begin(); vi!=m.veit.enu(); ++vi ) {
BoSomething((*vi).P()); }

1++"##0.O &SS /$" T&+"# &.N +*-V,/0.O /$"0M '&M[+"./"M
NyNesh::FaceIteiatoi fi; foi(fi = m.face.begin(); fi!=m.face.enu(); ++fi ) {
NyNesh::CooiuType b = ((*fi).v(u)->P() + (*fi).v(1)->P() + (*fi).v(2)->P() ) S.u;
}

oi using a common shoithanu foi accessing to the cooiu of a face veitex:
NyNesh::FaceIteiatoi fi; foi(fi = m.face.begin(); fi!=m.face.enu(); ++fi ) {
NyNesh::CooiuType b = ((*fi).P(u) + (*fi).P(1) + (*fi).P(2) ) S.u; }
0i even in a shoitei way:

NyNesh::FaceIteiatoi fi; foi(fi = m.face.begin(); fi!=m.face.enu(); ++fi ) {
NyNesh::CooiuType b = vcg::Baiycentei(*fi); }

EM"&/0.O "S"-"./#
Cieating the simplest single tiiangle mesh.
m.Cleai(); Allocatoi<NyNesh>::Auuveitices(m,S);
Allocatoi<NyNesh>::AuuFaces(m,1); NyNesh::veitexPointei ivp|Sj;
veitexIteiatoi vi=in.veit.begin(); ivp|uj=&*vi;(*vi).P()=CooiuType ( 1.u, 1.u,
1.u); ++vi; ivp|1j=&*vi;(*vi).P()=CooiuType (-1.u, 1.u,-1.u); ++vi;
ivp|2j=&*vi;(*vi).P()=CooiuType (-1.u,-1.u, 1.u); ++vi; FaceIteiatoi
fi=in.face.begin(); (*fi).v(u)=ivp|uj; (*fi).v(1)=ivp|1j; (*fi).v(2)=ivp|2j;

look to complextiimeshcieateplatonic.hplatonic.h foi moie examples.

)"#/M*[0.O 5S"-"./#

Lazy ueletion stiategy.

Note that the two basic ueletion stiategies aie veiy low level functions. They
simply maik as ueleteu the coiiesponuing entiies without affecting the iest of
the stiuctuies. So foi example if you uelete a veitex with these stiuctuies
without checking that all the faces inciuent on it have been iemoveu you cieate a
non consistent situation. Similaily, but less uangeious, when you uelete a face its
veitices aie left aiounu so at the enu you can have uniefeienceu floating
veitices.

Allocatoi<NyNesh>::Beleteveitex(m,v); Allocatoi<NyNesh>::BeleteFace(m,v);
If youi algoiithm peifoims ueletion the size of a containei coulu be uiffeient
fiom the numbei of valiu element of youi meshes (e.g.:
m.veit.size() != m.vn m.face.size() != m.fn
S8
Theiefoie when you scan the containeis of veitices anu faces you coulu
encountei ueleteu elements so you shoulu take caie with a simple !IsB() check:
NyNesh::FaceIteiatoi vi; foi(fi = m.face.begin(); vi!=m.face.enu(); ++fi )
if(!(*fi).IsB()) <---- Check auueu { NyNesh::CooiuType b =
vcg::Baiycentei(*fi); }

In some situations, paiticulaily when you have to loop many many times ovei
the element of the mesh without ueletingcieating anything, it can be piactical
anu convenient to get iiu of ueleteu elements by explicitly calling the two
gaibage collecting functions:
Allocatoi<NyNesh>::Compactveitexvectoi(m);
Allocatoi<NyNesh>::CompactFacevectoi(m);

Aftei calling these function it is safe to not check the IsB() state of eveiy element
anu always holus that:
m.veit.size() == m.vn m.face.size() == m.fn

Note that if theie aie no ueleteu elements in youi mesh, the compactoi functions
ietuins immeuiately.

1Nn&+".+[ M"S&/0*.#
vCu meshes B0 N0T stoie euges, only veitex anu tiiangles. Even the basic
aujacency ielations have to be explicitly computeu. We always tiy to uo not stoie
pei-euge infoimation anu we tiy to keep such infoimation only moie oi less
implicitly. This is simply because theie aie many algoiithms that uo not explicitly
iequiie this infoimation anu the cost of upuatingstoiing shoulu be avoiueu
when possible. In many cases algoiithms that seems baseu on some kinu pei-
euge iteiation oi infoimation can be ie-wiitten in a moie efficient way by
moving the loop to othei mesh elements.

E*,./0.O '*MN"M "NO"# dP0/$*,/ /*V*S*O[e
Typical example aie boiuei flags. Each face keep a bit foi each of its siues saying
if that face has a bounuaiy on that siue oi not. This infoimation can be accesseu
by mean of the IsB(i) function. To compute the boiuei flags theie aie vaiious
algoiithm accoiuing to the available topological infoimations.
Allocatoi<NyNesh>::CompactFacevectoi(m);
0puateFlags<NyNesh>::FaceBoiueiFiomNone(m); int BoiueiEugeCountei=u;
NyNesh::FaceIteiatoi fi; foi(fi = m.face.begin(); fi!=m.face.enu(); ++fi ) {
foi(int i=u;i<S;++i) if((*fi).IsB(i)) BoiueiEugeCountei++; }

E*,./0.O '*MN"M "NO" d,#0.O @@ &Nn&+".+[e
When youi mesh as Face-Face aujacency the FFp(i) membei stoie the pointei of
the face that is aujacent to the cuiient face along the i-th eug
int BoiueiEugeCountei=u; NyNesh::FaceIteiatoi fi; foi(fi = m.face.begin();
fi!=m.face.enu(); ++fi ) { foi(int i=u;i<S;++i) if((*fi).FFp(i) == &*fi)
BoiueiEugeCountei++; }

oi alteinatively using the same flag baseu appioach as above
S9
0puateFlags<NyNesh>::FaceBoiueiFiomFFAujacency(m); int
BoiueiEugeCountei=u; NyNesh::FaceIteiatoi fi; foi(fi = m.face.begin();
fi!=m.face.enu(); ++fi ) { foi(int i=u;i<S;++i) if((*fi).IsB(i))
BoiueiEugeCountei++; }

%0+".#"#
NeshLab uses some thiiu paity open souice libiaiies foi its woiking. Beie is the
complete lists of the piojects that we giatefully thanks foi theii kinu libeiality.
NeshLab is licenseu unuei the uN0 ueneial Public License (uPL).

vCu Libiaiy, uevelopeu at the visual Computing uioup - ISTI - CNR.
Responsible foi all the mesh piocessing anu ienueiing tasks. (uPL)
QT, TiollTech the stanuaiu fiamewoik foi high peifoimance, cioss-
platfoim application uevelopment.
uLEW: The 0penuL Extension Wianglei Libiaiy (BSB)
libSus a softwaie libiaiy foi managing SB-Stuuio Release S anu 4 ".SBS"
files. (LuPL)
bzip2 a fieely available, patent fiee, high-quality uata compiessoi. (BSB)
0niveisal SB Sample Softwaie Set of libiaiies to wiite, ieau, extenu,
ienuei anu inteiact with 0SB-foimatteu uata, as uefineu by stanuaiu
ECNA-S6S. This libiaiy is not uiiectly linkeu but the 0SB plugin invokes
the iutfcoveiteu executable, whose souices aie pioviueu with the
examples of the libiaiy. A binaiy of the iutfconveitei is uiiectly pioviueu
with the NeshLab uistiibution.
Poisson Suiface ieconstiution, heavily baseu on the coue kinuly pioviueu
by Nichael Kazhuan anu Natthew Bolitho (custom license thanks Nisha
anu Natthew!)
movie1S Latex package a LaTeX style to embeu movies, sounus anu SB
objects into PBF uocuments; the neeueu glue to geneiating puf with
embeuueu 0SB objects.
Some of the euiting tools icons came fiom Tango Icon Libiaiy piojects.

CM0U&+[ )0#+S&0-"M
NeshLab will automatically check foi the availability of upuateu veisions anu
will notify the neeu of upgiauing the softwaie to the useis. Foi this ieason, fiom
time to time, NeshLab will issue a http netwoik connection. If you piefei that
NeshLab uoes not communicate in any way with its uevelopeis, simply use a
plain fiiewall anu pievent any NeshLab access to the netwoik. This will not limit
in any way the noimal behavioi of NeshLab (apait fiom getting notifieu of new
NeshLab ieleases) Noieovei, when using NeshLab, it locally collects some
aggiegateu statistical uata about only the specific usage of NeshLab: the oveiall
numbei anu aveiageu size of the openeusaveu meshes; nothing moie.
Peiiouically this infoimation is sent back to the uevelopeis. This uata will be
useu foi statistical analysis anu foi the assessment of the NeshLab usage. We
woulu like to iemaik that the kinu of infoimation collecteu by NeshLab is
piobably by fai less sensitive than the infoimation that is silently collecteu by
most web sites when you suif them: IP auuiess, visiteu pages, fiequency of
ietuin. We woulu also like to stiess that we ieally neeu this infoimation in oiuei
to assess how uiffuse NeshLab is useu anu its impact on the SB community.
6u

1+X.*PS"NO-"./#
Some of the NeshLab uevelopeis got financial suppoit foi theii woik. Foi the
Italian CNR employees (anu foi the othei involveu paitneis) we acknowleuge the
financial suppoit of the following piojects:
YLKM";"(- (E0 IST): "The ieseaich leauing to these iesults has ieceiveu
funuing fiom the Euiopean Community's Seventh Fiamewoik
Piogiamme (FP72uu7-2u1S) unuei
giant agieement n 2S18u9"
EP0CB (E0 Netwoik of Excellence, IST-2uu2-Su7S82)
NI0R "BL0-ARCBE0SYS", 2uu6-2uu9

1 T,SS[ +*-VM"$".#0U" O,0N" *. PM0/0.O &. 2: CS,O0. T*M !"#$%&'

?*P /* N*P.S*&N !"#$%&' &.N &SS /$" M"S&/"N #/,TT

Please note that NeshLab uses Qt suk, so fiist of all you have to uownloau it fiom
http:www.qtsoftwaie.comuownloaus .

In oiuei to get the last veision of NeshLab's coue you neeu (if you haven't
alieauy one) a SvN client. We suggest Toitoise SvN. It pioviues a simple anu
complete inteiface to inteiopeiate with a SvN Seivei.

In the next steps I will assume you have it:
cieate eveiy wheie you want an empty foluei anu calleu it meshlab (foi
instance in %KlC,G,+l),#1+"N )
iight click on the cieateu foluei than on the menu clik on >(RF %1,%B8:.>
item . 0n the "uil of iepositoiy" paste anu copy
https:meshlab.svn.souicefoige.netsvniootmeshlabtiunkmeshlab
at the same level of the pieviously cieateu meshlab's foluei auu anothei
foluei anu calleu it vcglib (following the assumption of the pievious
example %KlC,G,+lG%0+$N )
iight click on the cieateu foluei than on the menu clik on >(RF %1,%B8:.>
item . 0n the "uil of iepositoiy" paste anu copy
https:vcg.svn.souicefoige.netsvniootvcgtiunkvcglib . vCuLib is a
geometiic anu algoiithmic libiaiy uevelopeu in oui lab. NeshLab uses it
extensively.

?*P /* +*-V0S" !"#$%&' &.N &SS /$" M"S&/"N #/,TT
Now you have succesfully uownloaueu all you neeu in oiuei to compile meshlab.
NeshLab uses a few thiiu paits uPL libiaiies. You will finu them in
),#1+"Nd#/%d,P.,/2"+ . In this foluei theie is also a usefull file calleu ,P.,/2"+&*/8
to simply compile all the exteinal uepenuecies.

If you hau coiiectly installeu qt on youi pc in the winuows stait menu you
shoulu have a Qt item anu in the subitem one labelleu >T. M&P %8))"2C */8)*.> .
Click on it, a uos shell will appeai.

You have to go to foluei ),#1+"Nd#/%d,P.,/2"+. Then wiite:
61
qmake -iecuisive exteinal.pio make

with the last two commanus you have compileu the exteinal libiaiies. Then , in
the same uos shell, you have to uigit

cu .. qmake -iecuisive meshlabv12.pio make

anu aftei waiting a long time (uepenuing on youi pc's piocessoi) you have
eventually compileu meshlab anu all his plugins.

Please note that in the qt suk package is incluueu a usefull IBE calleu QtCieatoi
with wich you coulu avoiu to manually uigit the pievious commanus. All you
have to uo is click on >D$+,Vm8*,2> anu impoit the pio file in it anu then click on
the >N:$+C> option.

QtCieatoi is a goou tool but the best way to compile anu wiite coue foi meshlab
maybe is visual Stuuio 2uu8 Expiess Euition + Qt visual Stuuio Integiation Tool
(you coulu uownloau it in the "othei uownloau" section). In this case you have
only to click on >c.Vm8*,2 #8+:.$82 D/8) &*/8 D$+,> to stait to woik with NeshLab's
coue.

?*P /* P*MX P0/$ !"#$%&'j# -"#$

The next step is to unueistanu how mesh woiks in NeshLab. NeshLab's uefines a
CNesh0 class. A CNesh0 is a collection of veitices anu tiiangulai faces. A Face is
(mainly) a thiee pointeis stiuctuie to veitices that composeu it. Eveiy veitex
coulu be iefeiieu by zeio, one oi moie faces. A veitex is (mainly) a class
composeu by a Su point in space, a veitex- noimal, a coloi anu a 2u textuie
cooiuinates.

G1;4243bbb .8 :#, G,/.,PV.,P.:/, %88/C$2".,# 68: @<(Q D$/#. ,2"N+, $.` 8.1,/H$#,
68:/ *+:0$2 H$++ %/"#1a

You will finu all the veitices in an c++ vectoi calleu veit anu the faces in a vectoi
calleu face. Typically a NeshLab plugin's function has a NeshNouel paiametei. A
NeshNouel contains a CNesh0 you coulu iefei to this instance via the cm
NeshNouel's membei. In othei woius supposing you have a function with a
NeshNouel paiametei calleu mymesh you coulu access to CNesh0 veitices with:
mymesh.cm.veit|iij; dd$$ $# "2 :2#$02,C $2. $2C,P .8 " *"/.$%:+"/ G,/.,P $2 .1, ),#1

with:
mymesh.cm.face|iij; dd68: %"2 "%%,## .8 .1, $$ D"%,

anu with:
mymesh.cm.face|iij.v(jj); dd68: H$++ 0,. .1, *8$2.,/ .8 .1, ZZ G,/.,P \ 4 ng ZZ n L] $2
.1, $$ D"%,
vcglib also pioviues a way to simply anu safely auu anu iemove faces oi veitices
fiom a mesh.
62
vcg::tii::Allocatoi<CNesh0>::Auuveitex(mymesh.cm,new veitex to be auueu);
vcg::tii::Allocatoi<CNesh0>::AuuFace(mymesh.cm,new face to be auueu);

The auu functions aie uefineu in the G%0+$NlG%0l%8)*+,Pl./$),#1l"++8%".,&1 .

To enable textuie cooiuinates pei veitex (oi foi example quality foi veitex) you
N0ST call the function:
mymesh.upuateBataNask(NeshNouel::NN_vERTTEXC00RB);

to test if the attiibute is alieauy enableu:
mymesh.hasBataNask(NeshNouel::NN_vERTTEXC00RB);

Please note that you coulu use also a combination of attiibutes:
mymesh.upuateBataNask(NeshNouel::NN_vERTTEXC00RB |
NeshNouel::NN_FACEQ0ALITY);
If you neeu moie uetaileu info about NeshLabvCuLib mesh you coulu take a
look to this link.

?*P /* PM0/" &. 2: CS,O0.

Suppose we have to wiite an impoiteiexpoitei foi an hypothetical .ext file
foimat. I suggest to put youi coue in the meshlab's foluei
),#1+"Nl#/%l),#1+"N*+:0$2#l$8e,P. . All the subsequent instiuctions will iefei to
coue inseiteu in this foluei.

NeshLab has a plugin aichitectuie. It means that you have to implement a
softwaie inteiface to let NeshLab's coie to inteiopeiate with youi plugin. All the
softwate inteifaces pioviueu by meshlab aie in the file
),#1+"Nd#/%d),#1+"Nd$2.,/D"%,#&1

You have to uevelop an inputoutput plugin. So you have to implement a
NeshI0Inteiface. In othei woius, supposing you plugin will be calleu
EXTImpoitei you have to wiite the something similai to the following coue:

file ext_plugin.h
#incluue "....meshlabmeshmouel.h" #incluue "....meshlabinteifaces.h"
#incluue "....meshlabfilteipaiametei.h" #incluue<QList>
class EXTImpoitei : public NeshI0Inteiface { public: QList<Foimat>
impoitFoimats(); QList<Foimat> expoitFoimats();
voiu uetExpoitNaskCapability(QStiing &foimat, int &capability, int
&uefaultBits);
bool open(const QStiing &foimat,const QStiing &fileName,NeshNouel &m,int
&mask, const FilteiPaiameteiSet & pai,vcg::CallBackPos *cb=u,QWiuget
*paient=u); bool save(const QStiing &foimat,const QStiing &fileName,
NeshNouel &m,const int mask, const FilteiPaiameteiSet & pai,
vcg::CallBackPos *cb=u,QWiuget *paient= u); };
in file ext_plugin.cpp you have to pioviue implementation to all the pievious
ueclaieu functions.
6S
I will explain the semantics of these functions one by one anu what they shoulu
uo.

>%0#/f@*M-&/g 0-V*M/@*M-&/#de
>%0#/f@*M-&/g "]V*M/@*M-&/#de
o they say to NeshLab what kinu of extensions the io plugin will
ieau oi wiite.You coulu copy & paste the following coue
QList<NeshI0Inteiface::Foimat> EXTImpoitei::expoitFoimats() const {
QList<Foimat> foimatList; foimatList << Foimat("EXT File Foimat",ti("EXT"));
ietuin foimatList; }
QList<NeshI0Inteiface::Foimat> EXTImpoitei::impoitFoimats() const {
QList<Foimat> foimatList; foimatList << Foimat("EXT File Foimat",ti("EXT"));
ietuin foimatList; }
U*0N 3"/5]V*M/!&#XE&V&'0S0/[d></M0.O oT*M-&/i 0./ o+&V&'0S0/[i 0./
oN"T&,S/K0/#e
o it say (mainly) to the fiamewoik what kinu of extia-attiibutes
(veitex positions must be pioviueu as uefault) an I0 Plugin coulu
save on a file. A typical implementation coulu be:
voiu EXTImpoitei::uetExpoitNaskCapability(QStiing &foimat, int &capability,
int &uefaultBits) const { if(foimat.to0ppei() ==
ti("EXT")){capability=uefaultBits= vcg::tii::io::Nask::I0N_vERTC0L0R |
vcg::tii::io::Nask::I0N_FACEC0L0R;} }
'**S *V".d+*.#/ ></M0.O oT*M-&/i+*.#/ ></M0.O
oT0S"4&-"i!"#$!*N"S o-i0./ o-&#Xi+*.#/ @0S/"MC&M&-"/"M<"/ o
V&MiU+O__E&SSK&+XC*# p+'hLi>G0NO"/ pV&M"./hLe
o It is TBE function you have to implement to impoit a Su file foimat
in NeshLab
! ;<'?#3"'Z8 .)()-$#$(8%
! %82#. T(./$20 oD8/)". - the extension of the foimat (e.g.
"EXT")
! %82#. T(./$20 oD$+,F"),- the name of the file to be openeu
! @,#1@8C,+ o) - The mesh that is filleu with the file
content
! $2. o)"#B - a bit mask that will be filleu iepoiting what
kinu of uata we have founu in the file (pei veitex coloi,
textuie cooius etc). It is a value oi a combination of values
(via |) of type vcg::tii::io::Nask (you coulu finu it at
G%0+$NlH/"*l$8e./$),#1l)"#Be$8&1)
! %82#. 9$+.,/A"/"),.,/(,. o *"/ - The paiameteis that have
been set up in the initPie0penPaiametei(). IN A FIRST
INSTANCE Y00 C00LB F0RuET AB00T IT.
! G%0KK7"++!"%BA8# p%N - stanuaiu callback foi iepoiting
piogiess in the loauing
! T=$C0,. p*"/,2. - you shoulu not use this.
'**S #&U"d+*.#/ ></M0.O oT*M-&/i+*.#/ ></M0.O oT0S"4&-"i
!"#$!*N"S o-i+*.#/ 0./ -&#Xi+*.#/ @0S/"MC&M&-"/"M<"/ o V&Mi
U+O__E&SSK&+XC*# p+'hLi>G0NO"/ pV&M"./h Le
o It is the function to save mesh info in a file. it has the same
paiameteis of open function.
64

?*P /* PM0/" & P*MX0.O 7VM* T0S"

G1;4243b Q1$# #,%.$82 H$++ N, )8#. "2 >18H .8 )"B, c:$%B+6 "++ .1, .1$20#
H8/B$20> "2C "N#8+:.,+6 28. " %8)*+,., /,D,/,2%, .8 >18H H/$., " 088C */8 D$+,>.
A pio file is a soit of makefile foi qt. It is coulu be usefull in oiuei to compile youi
plugin uiiectly fiom youi piefeiieu IBE anu to cieate youi own meshlab ielease.
In the next steps I will suppose you hau put youi coue in
),#1+"Nl#/%l),#1+"N*+:0$2#l$8e,P..
0pen with a text euitoi (also notepau it's ok) the file
),#1+"Nl#/%l),#1+"N*+:0$2#l),#1+"N*+:0$2#G3E&*/8 anu auu the foluei of
youi own plugin (i.e. io_gsu)
Fiom the uiiectoiy ),#1+"Nl#/%l),#1+"N*+:0$2#l$8e,P. take the $8e,P.&*/8
file.
copy anu paste in ),#1+"Nl#/%l),#1+"N*+:0$2#l$8e,P. then change his
name in $8e,P.&*/8
open it with notepau
o in the TARuET section change the value to io_gsu (this will be the
name of youi geneiateu plugin's ull)
o in the BEABERS section iemove "io_pub.h \
$$vCuBIRwiapplyplylib.h" anu auu all the .h files neeueu by
youi plugin
o in the S00RCES section iemove "io_pub.cpp \
$$vCuBIRwiapplyplylib.cpp\" anu auu all the .cpp files. Plese,
you !9<64j6 iemove ....meshlabfilteipaiametei.cpp otheiwise
youi plugin will have pioblem on linking time.
If you use QtCieatoi oi vs ieopen the meshlabv12.pio. You shoulu see
youi plugin's files listeu on the tiee view wiuget.
Now you can simply compile youi plugin!

Você também pode gostar