• No results found

Conversion of B-rep CAD models into globally G1 triangular splines

N/A
N/A
Protected

Academic year: 2021

Share "Conversion of B-rep CAD models into globally G1 triangular splines"

Copied!
17
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

University of Groningen

Conversion of B-rep CAD models into globally G1 triangular splines

Hettinga, Gerben Jan; Kosinka, Jiří

Published in:

Computer aided geometric design

DOI:

10.1016/j.cagd.2020.101832

IMPORTANT NOTE: You are advised to consult the publisher's version (publisher's PDF) if you wish to cite from

it. Please check the document version below.

Document Version

Publisher's PDF, also known as Version of record

Publication date:

2020

Link to publication in University of Groningen/UMCG research database

Citation for published version (APA):

Hettinga, G. J., & Kosinka, J. (2020). Conversion of B-rep CAD models into globally G1 triangular splines.

Computer aided geometric design, 77, [101832]. https://doi.org/10.1016/j.cagd.2020.101832

Copyright

Other than for strictly personal use, it is not permitted to download or to forward/distribute the text or part of it without the consent of the author(s) and/or copyright holder(s), unless the work is under an open content license (like Creative Commons).

Take-down policy

If you believe that this document breaches copyright please contact us providing details, and we will remove access to the work immediately and investigate your claim.

Downloaded from the University of Groningen/UMCG research database (Pure): http://www.rug.nl/research/portal. For technical reasons the number of authors shown on this cover page is limited to 10 maximum.

(2)

Gerben

Jan Hettinga

,

Jiˇrí Kosinka

BernoulliInstitute,UniversityofGroningen,TheNetherlands

a

r

t

i

c

l

e

i

n

f

o

a

b

s

t

r

a

c

t

Articlehistory:

Received26September2019

Receivedinrevisedform1February2020 Accepted5March2020

Availableonline9March2020 Keywords:

CADmodel Clough-Tocherspline Shirman-Séquinspline Béziertriangle

Existing techniques that convert B-rep (boundary representation) patches into Clough-Tocher splines guarantee watertight, that is C0, conversion results across B-rep edges.

In contrast, our approach ensures global tangent-plane, that is G1, continuity of the convertedB-repCADmodels.Weachievethisbycarefulboundarycurveandnormalvector management,and byconverting the input models intoShirman-Séquinmacro-elements neartheir(trimmed)B-repedges.Weproposeseveraldifferentvariantsandcomparethem withrespecttotheirlocality,visualquality,anddifferencewiththeinputB-repCADmodel. Althoughthe same globalG1 continuity can alsobeachieved byconversion techniques

basedonsubdivisionsurfaces,ourapproachusestriangular splinesand thusenjoysfull compatibilitywithCAD.

©2020TheAuthor(s).PublishedbyElsevierB.V.Thisisanopenaccessarticleunderthe CCBYlicense(http://creativecommons.org/licenses/by/4.0/).

1. Introduction

Traditionalcomputeraideddesign(CAD) systemsrelyonboundaryrepresentations(B-reps),meaningthatCADmodels are described interms oftheir outer shells rather than assolids. The standardCAD representationofsurfaces isthat of non-uniformrationalB-splines(NURBS)(PieglandTiller,1995),an extensionofB-splinescapableofexactly representing, amongother shapes,conicarcs intheunivariate caseandquadric patchesinthecaseofbivariatetensor-productNURBS. However,theinherenttopologicalrestrictionoftensorproductsmeansthatonlytopologicaldisks,cylindersortoricanbe representedusingasingleNURBSpatch.Other,morecomplexshapesneedtobecoveredusingmultiplepatcheswhichare trimmedagainsteachotherandthentopologicallystitchedintheresultingB-rep.

Whilethisallowsonetomodelshapesofarbitrarymanifoldtopology,thefactthattheintersectioncurveoftwoNURBS patchesisnot, ingeneral,aNURBS curvemeans thatCADmodelsarenot geometricallywatertight,i.e.,not evenC0 con-tinuous.Thetrueintersectioncurvesareonlyapproximatedby NURBS(trimming)curves.Theresultinggaps(oroverlaps) canbekeptbelowmachineprecisionandthusdonotposemajorproblemswhenmanufactured.However,inthecontextof analysisandsimulation,thiscausesmajorissues(MarussigandHughes,2018).

OnesolutionistomeshtheCADmodeltoobtainapiece-wiselinearandwatertightrepresentationforafiniteelement (FEM)computation.However, withtheadventofisogeometricanalysis(IgA)(Cottrelletal.,2009),whichpromotestheuse ofexactgeometryandsuggeststo usethesamebasisfunctionsusedtodescribetheshapealsoforspanningthesolution space,variousgeometryconversionmethodshavebeeninvestigatedtoturnCADmodelsintohigher-order(i.e.,notsimply piece-wiselinear)analysis-suitablerepresentations.

*

Correspondingauthor.

E-mailaddress:g.j.hettinga@rug.nl(G.J. Hettinga).

https://doi.org/10.1016/j.cagd.2020.101832

0167-8396/©2020TheAuthor(s).PublishedbyElsevierB.V.ThisisanopenaccessarticleundertheCCBYlicense (http://creativecommons.org/licenses/by/4.0/).

(3)

However,existingconversionmethodssufferfromoneofthefollowingtwoshortcomings.Theresultingglobalcontinuity is notbetter than C0 (KosinkaandCashman, 2015; Massarwietal., 2018), ortherepresentationofchoice isnot directly CADcompatible (Shenetal.,2014,2016b).

Incontrast,weprovideamethodbasedonClough-Tocher (CloughandTocher,1965)andShirman-Séquin(Shirmanand Séquin, 1991) macro-elements which converts B-rep CAD models into globally tangent-plane (G1) continuous triangular splines. As only cubic andquartic Bézier triangles (Farin, 1986) are produced, the converted surface is CADcompatible. AlthoughthevisualimprovementovertheC0 methodofKosinkaandCashman(2015) isoftenmarginal,themainadvantage ofourapproach isthatitprovides exactG1 smoothness,whichisimportantindownstream applicationssuchasanalysis andsimulation,forexampleinthecontextofenhancedFEM(Sevillaetal.,2011).

We reviewanddiscussexistingconversionmethods inSection 2.Thebuildingblocksofourapproacharedescribed in Section 3.The necessarypreprocessingof datasampledfromCADmodelsis discussedinSection 4.Section 5covers our main contribution,i.e.,how togenerateaglobally tangent-plane continuousapproximation ofaninput B-repCADmodel. Ourresultsare presentedinSection6.As weofferseveralvariantsoftheconversion method,we provideadiscussion in Section7.ThepaperisconcludedinSection8.

2. Relatedwork

ThewidelyadoptedstandardofrepresentingCADmodelsasB-repsusingtrimmedandstitchedNURBSpatchesinevitably producesnon-watertightgeometries.Thishaspromptedinvestigationsintobetterrepresentationmethodsandrelated con-versiontechniques,especiallyinthecontextofisogeometricanalysis(MarussigandHughes,2018).

Theseconversionsareeitherexact,meaningthatthegeometryremainsintactbutalsonon-watertight,orapproximate. Theformerclassofexacttechniquesisrepresentedbyuntrimming(ElberandKim,2014;Massarwietal.,2018).Whilethis ensuresthattheconvertedpatchesarenolongertrimmed,thecontinuityoftheCADmodelinevitablydoesnotchange.

The latterclass of approximate techniques necessarily modify the input geometry, butthe resulting conversion error istypically controllableandoftenconfinedtoregionsneartheB-repedges(trimmingcurves).Existingtechniquesinclude conversiontoCatmull-Clark(Shenetal.,2014)andLoop(ShenandKosinka,2016)subdivisionsurfaces.Animprovedvariant in whichregions away fromthetrimming curves canbe kept unmodifiedwas recentlypresented inShenet al.(2016b). These techniques offer globally G1 approximations, but are not directly CAD-compatible due to the lack of closed-form representations inirregularregions. AcloselyrelatedmethodconvertsCADmodels intoT-splines (Sederbergetal., 2008), butagain,T-splinesrelyonsubdivisionorapproximateG1 conditionsnearirregularregions.

A promising approachto tacklethe trimming problemis basedon watertight Booleanoperations (Urick etal., 2019). While it produces watertight models, the placement of extraordinary points and feature lines in the method remains a manualtask.

CAD models can be converted into collections of curved triangles. This approach was taken in Xia andQian (2017), whichalsooffers avolumetriccounterpart.However,their constructionisbasedontheClough-Tocher-Hsiehsplit (Clough and Tocher, 1965) andparametric continuity, andthus produces globally only C0 results.An earlier technique based on Clough-Tocher splinesappearedinKosinkaandCashman(2015).ThisoffersCAD-compatiblepatches,butingeneralresults inonlyC0continuityacrossbutalsonearB-repedges.

To remedy this, we present a technique based on polynomial Bézier triangles and the Shirman-Séquin construction (Shirman and Séquin, 1991) to enhance existing Clough-Tocher techniques such that globally tangent-plane continuous modelsareobtained.

3. Preliminaries

We start by introducing basic concepts including Bézier triangles andcontinuity conditions between them. Then we discusstheClough-TocherconstructionandtheShirman-Séquinconstruction.

3.1. Béziertriangles

Apoint p inanon-degeneratetriangle

T (v

0

,

v1

,

v2

)

withverticesv0

,

v1

,

v2 isuniquelygivenby itsbarycentric coordi-nates

τ

= (

u

,

v

,

w

)

astheconvexcombination

p

(u,

v,w)

=

uv0

+

vv1

+

wv2

;

u

+

v

+

w

=

1

,

u,v,w

0

.

(1) Anypolynomial p oftotaldegreeatmostd definedon

T

canbeexpressedintheBernstein-Bézierform

p(

τ

)

=



|i|=d PiBdi

(

τ

),

where Bdi

(

τ

)

=

d

!

i

!

j

!

k

!

u ivjwk (2)

(4)

Fig. 1. ThecontrolnetofacubictriangularBézierpatchP withcontrolpointlabels.AsectionofthecontrolnetofanadjacentC0-connectedpatchP is¯

alsoshown;controlpointsP003,P012,P021,andP030areshared.

Generalisingthisfunctionalsettingtotheparametricone,aBézierpatchP isobtainedintheform p

(

τ

)

=



|i|=d

PiBdi

(

τ

)

(3)

withcontrolpoints Pi

∈ R

3,associatedwiththebarycentriccoordinates i/d,forminga triangularcontrol net.Anexample

inthecubiccaseisshowninFig.1.

Béziertrianglescanbedegreeelevated(Farin,1986)via Pi

=



ik>0

ik

d

+

1PiIk

,

(4)

whereik isthek-thelementofi andIkisthek-throwofthed

×

d identitymatrix.Degreeelevationofboundarycontrol pointsreducestodegreeelevationforBéziercurves.

3.2. Continuityconditions

Consider the situation sketched in Fig. 1. The C1 continuity conditions betweentwo cubic Bézier triangles P and P

¯

andtheirrespectivetrianglesinparameterspace

T (

v0

,

v1

,

v2

)

and

¯T (

v1

,

v3

,

v2

)

are,alongwiththetrivialC0conditionsof sharededgecontrolpoints,givenby

¯

P012

=

τ

0P102

+

τ

1P012

+

τ

2P003

,

¯

P111

=

τ

0P111

+

τ

1P021

+

τ

2P012

,

¯

P210

=

τ

0P120

+

τ

1P030

+

τ

2T021

,

(5)

where

(

τ

0

,

τ

1

,

τ

2

)

arethebarycentriccoordinatesofv3withrespectto

T

,i.e., v3

=

τ

0v0

+

τ

1v1

+

τ

2v2.Inotherwords,the threequadrilaterals

(P

102

,

P012

,

P

¯

012

,

P003

)

,

(P

111

,

P021

,

P

¯

111

,

P012

)

,and

(P

120

,

P030

,

P

¯

210

,

P021

)

havetobeplanarandofthe sameaffineshapeasthequadrilateral

(v

0

,

v1

,

v3

,

v2

)

inparameterspace.

G1 continuityistypicallylessrestrictivecomparedto C1 continuity(Peters,2002):twoBéziertrianglesmeetata com-monboundarycurvewithG1continuityifthecommontangentplanealongthatcurvevariescontinuously.Let

(

v

)

bethe commonboundarycurveofBéziertriangles P andP ,

¯

andlet

∂

P

(

v

)

and

∂

P¯

(

v

)

expresscross-boundaryderivativesofthe

respectivetriangles along

(

v

)

.Asufficient andnecessary condition forG1 continuityis givenbythe co-planarityofthe threetangentvectors

(

v

)

,

∂

P

(

v

)

and

∂

P¯

(

v

)

along

(

v

)

,i.e.,

det



∂(

v

), ∂



P

(

v

), ∂

P¯

(

v

)



=

0

,

v

∈ [

0

,

1

].

Thisconditioncanbeexpressedintermsofthreescalarfunctions

α

(

v

)

,

β(

v

)

and

γ

(

v

)

:

α

(v)∂

P

(v)

= β(

v)∂P¯

(v)

+

γ

(v)∂(v),

v

∈ [

0

,

1

].

(6) TosolvetheproblemofG1continuitybetweenBéziertriangles,weexploitthesethreefunctions,aswedetailbelow.

(5)

Fig. 2. ThelocalG1methodofChiyokura&Kimura,connectingtwoBéziertriangles.Thearrowsshowthevectorsinvolvedinthecomputation.Thepoints

markedbydiamondsare‘quartic’controlverticesobtainedbydegreeelevation.

3.3. ThemethodofChiyokura&Kimura

The methodof Chiyokura and Kimura(1983), alsocalled the CK-method, is a method that joinstwo tensor-product Bézier patches withG1 continuityby onlytakingintoaccount sharedpositionalandnormaldata,whichmakes ita fully localmethod.Itwaslatergeneralisedtocoveralsotriangularpatches(Longhi,1985),andthatistheversionwenowrecall. Consider thesituationdepictedinFig.2whereanactualpatch A isconnectedtoabasispatchB,hereunderstoodasa ribbongivenbytworowsofcontrolpoints.Thebivectorsbelongto B,ci arevectorsofthecubiccontrolpolygondefining thecommonboundaryedge,andai belongto A.Further,b0 andb3 areunitvectorsorthogonalto c0 andc2,respectively, andlieinthetangentplanesdefinedby thenormalsoftheend-pointsofthesharededge.The firstrowofcontrolpoints fromtheboundary,i.e.,thosepointedtobyai,arequarticcontrolpointsobtainedbydegreeelevation;seeEquation (4).

Equation(6) isthenreformulatedto:

∂

A

(

v

)

= β(

v

)∂

B

(

v

)

+

γ

(

v

)∂(

v

),

v

∈ [

0

,

1

],

suchthattheactualpatchisjoinedwithG1 continuitytothebasispatch.Tosolvethisequation,wefirstexpressa0anda3 as

a0

= β

0b0

+

γ

0c0

,

a3

= β

1b3

+

γ

1c2

,

β

0

, β

1

,

γ

0

,

γ

1

∈ R,

andset

β(v)

= (

1

v)β0

+

1

,

γ

(v)

= (

1

v)

γ

0

+

v

γ

1

.

(7) It is then assumed that

∂

B is only quadraticand that vectorsb1 andb2 can be determined by linearinterpolation as

b1

=

23b0

+

13b3,b2

=

13b0

+

23b3.Allcombined,thisleadsto

a1

= (β

1

− β

0

)

b0 3

+ β

0b1

+

γ

1 c0 3

+

2

γ

0 c1 3

,

a2

= β

1b2

− (β

1

− β

0

)

b3 3

+

2

γ

1 c1 3

+

γ

0 c2 3

.

Ultimately, the connection to the basis patch can be done using data fromthe common boundary only. The method is appliedtobothsidesseparately,andthusbothsidesareconnectedtothesamebasispatchandthereforetheactualpatches joinwithG1continuity.

3.4. TheClough-Tocherconstruction

Insituationswhereasinglepatchwithaparametrisationisgiven,asisthecasewithB-reppatches,onecanemploythe Clough-Tocherconstruction(CloughandTocher,1965)toturnthispatchintoaC1 collectionofcubic(macro-)triangles.We nowrecallthemainstepsinthisconversionprocess;moredetailscanbefoundinKosinkaandCashman(2015).

To startwith, asuitable triangulation oftheparametric domainofthe patchisconstructedso that thecorresponding triangularmeshin3D withvertexpositionssampledfromthepatchprovidesasatisfactoryapproximation.Manymethods can be used forthis purpose, including for example Tristano et al. (1998); Busaryev et al.(2009); Shen etal. (2016a), andby suitable we meanthatthe triangulationshould meetthecriteriaimposed by agivenapplication, such asvarious tolerances on triangle and approximation quality. The examples in this paper rely on the CADfixproduct (International TechneGroup Ltd., 2019) toimport CADmodels andgeneratethe requiredtriangulation (andalso gradients asdescribed below).TheCADfixmeshingprocessissimilartothatofKallmannetal.(2004),basedonincrementalconstrainedDelaunay triangulation.

(6)

Fig. 3. Left:AClough-Tochermacro-elementcomposedofthreecubicBézier(micro-)triangles.Right:TheShirman-Séquinconstructionshowinga combina-tionof‘cubic’(squares)and‘quartic’(diamonds)controlpoints.

Eachofthegeneratedverticesis,ontopofitsparametervaluevi,equippedwithitspositionPiin3Dontheinputpatch

p, aswell asthegradient

Pi withrespectto theparametrisationofp. InordertointerpolatethisdatawithaC1 cubic triangularspline,eachofthegeneratedtrianglesissplitintothree(cubic)micro-triangles,givingrisetomacro-elements.In ourexamples,thebarycentreisusedasthesplitpoint,althoughotheroptionsarepossible(SchumakerandSpeleers,2010; KosinkaandCashman,2015).

TheClough-Tocherconstruction,whichgeneratesacubictriangleovereachmicro-triangle,thenproceedsinthreesteps. First, the macro-triangle vertexcontrol points are set to their corresponding Pi, andthe macro-edge control points are computed,usingthenotationofFig.3,left,accordingto

Ti j

=

Pi

+

1

3

Pi

· (

vj

vi

)

tointerpolatealsothegradients.TheC1 continuityconditionsofEquation (5) areusedtocompute Ii1

=



Pi

+

Ti,i+1

+

Ti,i−1



/

3

,

(8)

withtheindexi

∈ {

0

,

1

,

2

}

understoodcyclically(modulo3).

Secondly,themicro-trianglecentralcontrolpointsQ01,Q12,andQ20aresetaccordingtooneofthemanyvariantsofthe Clough-Tocherconstruction; seeKosinkaandCashman(2015) for anoverview.Inourpaper,wemakeuseoftwovariants ofthe construction. One that uses additionalgradients sampledat themidpoints of edges (Kosinka andCashman, 2015, Section 3.6),andtheoriginalClough-Tochervariant(CloughandTocher,1965),(KosinkaandCashman,2015,Section 3.1)as specifiedbelow.

Thirdly,theremainingcontrolpointsarecomputed,againviatheC1continuityconditions.Thisyields Ii2

=



Ii1

+

Qi,i+1

+

Qi−1,i



/

3

,

andfinally S

= (

I02

+

I12

+

I22

) /

3

.

Inthis manner,C1 continuity isguaranteed acrossmacro-patch boundariesaswell asmicro-patch boundaries. Italso ensuresinterpolationoftheinputpositionsandgradients.

AstheClough-Tocher constructionreliesonaparametrisation,itdoesnotworkonsurfacesofarbitrarymanifold topol-ogy.WhenB-reppatcheshavingdifferentparametrisationsmeetatasharedB-repedge,theirgradientswill,ingeneral,not match.Thismaythenresultindiscontinuitiesattheseam.Toremedythis,KosinkaandCashman(2015) proposedtomove someofthecontrolpointsattheseamsuchthatthegeometrybecomesC0,namelybysnappingthemtothecontrolpoints ofacubicapproximationoftheB-repedge.Whilethisprocedurecreateswatertightresults,somemicro- andmacro-edges becomeC0 internally(astheC1conditionsareviolatedbythisadjustment),andthereisnosimple,non-degeneratewayof adjustingthecontrolpointsdifferentlyinordertoobtainG1 continuityattheseamsusingonlycubic(macro-)triangles.

(7)

3.5. TheShirman-Séquinconstruction

TheShirman-Séquinconstruction(ShirmanandSéquin,1991,1987)issimilartotheoriginalClough-Tocherconstruction asitisalsobasedonthesamesplitofthedomaintriangle.ThemaindifferenceisthattheShirman-Séquinconstructionis fullygeometric andusesquarticBézier trianglesinsteadofcubic ones.As such,it canovercometheparametric andthus topologicalrestrictionsofClough-Tochersplines.

TheShirman-SéquinconstructionmakesuseoftheCK-method(ChiyokuraandKimura,1983)(seeSection3.3)to guar-antee tangent-plane continuityof adjacent(macro-)triangles.The construction takesasinputa macro-triangle withcubic Béziercurvesonitsthreeedges.Inourcontext,itisassumedthatallcubicedgesincidentwithavertexofthemeshmeet therewithasharedtangentplane.

Consider thepatchlayout andlabelling asshowninFig.3,right. ThepositionsofIi1 aresetaccordingtoEquation (8). Thesearethen degreeraisedto

ˆ

Ii1

= (

Pi

+

3Ii1

) /

4 (notshowninthefigure),andusedintheCK-methodtodetermineall

Li,i+1 and Ki,i+1.These points are in turn used tocomplete the construction using combinations of‘cubic’ and‘quartic’ controlpoints Ii2

=



Pi

3Ii1

+

4Ki,i+1

+

4Li−1,i



/

6

,

Ni,i+1

=



Ii1

Ii+1,1

+

Ii−1,1

+

4Ii2

+

4Ii+1,2

3Ii−1,2



/

4

,

andfinally S

= (

I02

+

I12

+

I22

) /

3

.

Allboundarycurves,microandmacro,arethenfullydegreeraisedtoquarticstoobtainaquarticBéziertriangleoneach ofthemicro-triangles.Inessence,theShirman-SéquinconstructionisacombinationofthemethodofChiyokura&Kimura andFarin’smethod(Farin,1982).TheCK-methodisusedtocreateG1 joinsatmacro-edgesandFarin’smethodisusedto createG1joinsatmicro-edgesofthemacro-elements.

WenowhavealltheingredientsneededtoproceedtoourCADmodelconversionmethod.

4. Preprocessing

Consider a CAD model described by one or more (trimmed) B-rep patches. As described inSection 3.4,the Clough-Tocherconstructioncombinedwithasuitable error-driventriangulationmethodisusedtoturntheCADmodelintoa C−1 collection of C1-continuous Clough-Tocher splines (Kosinka andCashman, 2015), each described over its own parameter domain.

Atthesametime,thecorrespondingapproximatedB-repedgesaredescribedasC1-connectedcubicBéziercurveswhose end-pointscoincidewiththeverticesofthepolyline approximationsoftheB-repedges,andwhichalsointerpolatethe B-repedgederivativesthere.Theverticesofthesepolylinesofcourseappearintheoveralltriangulation,buttheBéziercurves donotnecessarilyexactlycoincidewiththepiece-wisecubicedgesoftheClough-Tochersplines;seeFig.4,left.

EachB-rep edgealsocomeswiththeinformationofwhetheritshouldbe treatedasasharpedge(with C0 continuity acrossit)orasasmoothedge(withG1 continuity).Ifthisinformationisnotprovidedorinthecaseofavanishingcrease, we rely onthenormalvector informationprovided bythe B-reppatches (topologically)incidentwiththat B-rep edge:if theanglebetweenthenormalsofthetwoincidentpatchesmeetingatavertexisbelowathreshold,thepartoftheedge nearthatvertexisconsideredsmooth,andsharpotherwise.SharpB-repedges(topologically)meetatsharpB-repvertices. As weaimfortrianglesofaminimaldegree,we keepall theinternal(macro-)trianglesobtainedbytheClough-Tocher construction intact, andonly apply the Shirman-Séquin construction nearthe B-rep edges, replacing some of the cubic triangles with quartic ones. But even for smooth edges, the boundary data sampled from the CAD model needs to be adjustedfirsttoensurethattheconstructioncanbeapplied.

4.1. G1-compatibleboundary

As mentionedinSection 3.4,the Clough-Tochermethodiscapable ofguaranteeingonly C0,andingeneralnot higher, continuitynearB-repedges,evenafteradjustingsome ofthecontrolpointsofthemicro-trianglesincident withtheedge. This holds even in the case when the gradients at the B-rep vertices span the same tangent plane; thisis dueto the parametricnatureofthemethod.

Therefore,weneedtoensurecommontangentialdataalongthesharedB-repedgesothattheShirman-Séquinmethod can beapplied. Thistranslatesintotherequirementofhavingsharednormals atallthevertices ofasmoothB-repedge. Toachievethis,weproposeatwo-stepadjustmentprocedure.Inthefirststepwedetermineanadjustednormalvectorfor all shared verticeswhich lie onthe commonboundary curve,andin thesecond step we ensurethat all curvesmeeting atsuchavertexrespectthisnormal.Weaddressthemostcommonconfigurationfirst;otherconfigurationsarecoveredin Section4.2.

Consider thesituationsketchedinFig.4,right. AvertexP ontheB-rep edge(showningrey) alsocorrespondstotwo positions,P1andP2,onthetwoB-reppatches(topologically)meetingthere.Thetwogradientssampledatthesepositions fromthepatchesgiveriseto,ingeneral,twodifferentnormals,n1 and n2.Wesimplyaveragethesetwonormalstoobtain

(8)

Fig. 4. Left:TwoNURBSB-reppatches,N1andN2,intersectingalongacurve.Thetrueintersectioncurve(dotted)cannot,ingeneral,berepresentedas

aNURBScurveandisthusapproximatedbyaNURBSB-repedge(grey).ButasthisB-repedgedoesnot,ingeneral,lieoneitherofthetwopatches,itis inturnapproximatedbytwotrimmingcurves(redandblue),oneoneitherpatch.Right:ThesituationatavertexP oftheB-repedge(grey).Duetothe (unavoidable)inexactnessofthetrimmingcurves(redandblue),P correspondstotwo,ingeneraldistinct,points,P1andP2,oneoneitherofthepatches

N1andN2.ThesmallergreycontrolpointsaredeterminedusingthederivativeoftheoriginalB-repedgeatP,andsimilarlyfortheredandbluecontrol

pointsalongthetwotrimmingcurves.TheotherredandbluepointscomefromtheconstrainedtriangulationsofthetwopatchesandtheClough-Tocher constructiononbothsides.Asthepatchnormalsn1andn2atresp.P1andP2donot,ingeneral,agreemutuallyorwiththeB-repedge,theyneedtobe

adjustedton.(Forinterpretationofthecoloursinthefigure(s),thereaderisreferredtothewebversionofthisarticle.)

n0(notshowninthefigure),butagainduetoCADtolerances,thisnormalisnotingeneralperpendiculartotheB-repedge atP.Therefore,weprojectn0 ontothenormalplane oftheB-repedgethere,andobtainthefinaln.Thissameprojection stepisalsoneededforthenormalsofsharpedges,asitstillmightnotagreewiththeB-repedge.Thesameprocedure,but withouttheaveraging step,isappliedto verticesthatlie onaB-rep edgethat isdeterminedto besharp.Inthiscaseits normalvectorcanbedirectlyprojectedontothenormalplaneoftheB-repcurve.

In the second step,we ‘snap’ the red andblue points aligned withthe edge onto the associatedgrey points; thisis shownby thegreyellipsesinFig.4,right.ThisisessentiallythesameadjustmentasinKosinkaandCashman (2015),and ensuresC0 continuity.

Further,we havetoensurethatalsothe other(straight) edgesemanatingfromP areorthogonal ton.Tothisend, we projecttheremainingpointstopologicallyedge-connectedtoP (notethatthisincludesalsoconnectionstoP1 andP2)onto theplanedefinedby P andn.Thisway,weoptimallyrespectthegradientsdefinedattheP-verticesinthesensethatthe projectedcontrolpointsareanaffinetransformationoftheirinitiallysetpositionsoneitherside.Thedatanowsatisfythe G1 assumptionsoftheShirman-Séquinconstruction.

4.2. Othervertexconfigurations

Naturally,otherconfigurationsthanthatshowninFig.4canarise.IfP isaninternalB-repedgevertex,its valencycan differfromthat shown, andtheadjustment needsto be appliedinslightlydifferentways. At T-junctionsandatvertices wheretwosmoothB-repedgesmeettransversally(X-junctions),theadjustednormaln istakentobethevector perpendic-ulartothetwoincidentB-repdirections.InthesecasesthevertexnormalisuniquelydefinedbytheB-repedgesmeeting atthevertex.

At B-repvertices marked(or judgedtobe) smooth (bydesign) withhighervalencies oratverticeswhere theunique normalsofadjacentpatchesareslightlyoff,n isdeterminedbyaleastsquarefit.Still,thismeansthattheB-repedgeshave tobeadjustedatthesehighvalencypoints,byprojecting,asabove,theedge-connectedcontrolpointsofP ontotheplane definedbytheleastsquaresfit.

Finally,sharpB-repedges keep theirtwo separatenormals n1 andn2 (or moreatsharpcornersofhighervalency).It maythusseemsufficienttousetheClough-Tocherconstructioninsuchsharpcases.Butalas,thecontrolpointadjustment toreachC0 continuityalsoruinsC1 continuityacrossthemicro-edgesnearthisadjustment,asalreadyobservedinKosinka andCashman (2015).Therefore,we usetheShirman-SéquinconstructionalsoatsharpB-repedges.Thisensuresthatonly thesharpedgesareC0,andthesplinesareatleastG1 everywhereelse.

5. ConversiontoShirman-Séquinsplines

After theboundaryadjustment,all thedataispreparedforG1 (orondemand C0) interpolation.Wenowhaveseveral options.Thefirstandobviousone isto usetheShirman-Séquinconstructionglobally.Thisisofcourserealisable, butitis computationallycheaperandingeneralpreferabletouselower-degreetriangleswherepossible.

(9)

Note that wecan categorisethe trianglesincident withB-rep edges inthe CADmodeltriangulationinto two groups: thosewithtwo(ormorevertices)ontheboundary,called2-connectedtriangles,orthosewithjustonevertexonthe bound-ary, dubbed1-connectedtriangles.Allother (non-boundary)trianglesareprocessedusingtheClough-Tocherconstruction, andarethusonly(piece-wise)cubic.

All1-connectedtrianglescanpotentiallyalsobeturnedintoClough-Tochermacro-elements,simplybecausethetwo-step adjustment doesnot ruintheir internal C1 continuity.Thesituationofthe 2-connectedtriangles isdifferent:the Clough-Tocher construction cannot be used due to the boundary normal adjustment step andthe above mentioned topological restrictions. The Shirman-Séquinconstruction cannotbe used naïvelyeither:theCK-methodexpectsa basis patchasthe cross-boundaryderivative.Fora1-connectedtriangleacross-boundaryderivativehasalreadybeendefinedbytheadjacent (micro-)triangle(s) of a Clough-Tocher construction and thisis in general different fromthe one constructed in the CK-method.

Intheinitialstepofallnewconstructions,theboundaryofeachmacro-triangleissetusingthesameprocedureaswith the standard Clough-Tocher macroelements. Thismeans that foreach boundary triangle a cubic Bézier control polygon hasbeendefined. Similarly,thepoints Ii1 (see Equation (8))canbe computed.Withthisallnecessarydataisavailableto startcreatingtheShirman-SéquinsplinesandtocreateG1 connectionbetweenthemusingtheCK-method.Assaidbefore, forthe 2-connectedtrianglesit isnotpossible tousethismethodto connect toadjacentClough-Tocher macro-elements. Therefore,wedesignanalternativeG1methodtohandle2-connectedtrianglesconnectedtoClough-Tocherelements. 5.1. AnalternativeG1method

Consider againthesituation shownin Fig.2, butthistime imagine that patch B isa cubicBézier triangle forwhich all controlpointpositionshavealreadybeendefined.Here,weencountera‘master-slave’situation.Thebasispatchofthe CK-methoddoesnot,ingeneral, agreewiththe tangentplaneofan arbitrarycubicBéziertrianglealong

(

u

)

,andsowe needtoproceeddifferently.

The first two rowsof control points of B, themaster, are used toconstruct a cross-boundaryderivative

∂

B

(

v

)

of B along

(

v

)

. We are free to choose the directionof the derivative, aslong as it is transversalwith respect to the edge, such asthe orthogonaldirectionto theedge inparameter space. However,to ensureinvariance oftheconstruction with respect tovertexindexingandaffinereparametrisations, wetake itto bethe directiongivenby theparametric midpoint ofthesharededgeandtheoppositevertexinparameterspace.UsingthenotationofSection3.1,thisdirectionisgivenby

(v

1

+

v2

)/

2

v3.

Thecorrespondingtransversalderivativeisquadraticandgivenbythreecontrolvectors,whichwedenotebyd0,d1,and

d2.

TurningbacktoEquation (6),weobtain

α

(v)

3



i=0 B3i

(v)

ai

= β(

v) 2



i=0 B2i

(v)

di

+

γ

(v)

2



i=0 B2i

(v)

ci

,

(9) where B2

i

(

v

)

andB3i

(

v

)

aretheunivariatequadraticandcubicBernsteinpolynomials,respectively.Wechoosethefunctions

β

and

γ

tobelinearpolynomials,justasinEquation (7),andset

α

(

v

)

1.Thenwedeterminethecoefficients

β

0

,

β

1 and

γ

0

,

γ

1 bysolvingEquation (9) with v

=

0 andv

=

1,i.e.,bysolvinga0

= β

0d0

+

γ

0c0 anda3

= β

1d2

+

γ

1c2.

Thesought-aftervectorsa1anda2 canthenbefoundvia

a1

=

1 3

1d0

+

γ

1c0

)

+

2 3

0d1

+

γ

0c1

),

a2

=

2 3

1d1

+

γ

1c1

)

+

1 3

0d2

+

γ

0c2

).

Thisinturngivesthequarticcontrolpoints,shownasdiamondsinFig.2,of A,theslave,such thatitconnectsto B with G1continuity.

Notethatitisingeneralimpossibletoobtain A asacubicpatch.Indeed,modifyingtheleft-handsideofEquation (9) to

α

(

v

)



2i=0B2

i

(

v

)a

i admitsnosolutionforgenericinputdataasthenonlya1 remainsasanover-constrainedfreedomwhen

a0 anda2 aregiven.

ItisnowapparentthatwehavetwooptionsnearB-repedges.Oneoptionistoconvertthewholestripof2-connected and1-connected trianglesinto aShirman-Séquinspline strip. Wecall thisapproach‘full-strip’. The other optionisto do thisonlytothe2-connectedtriangles.Asasaw-tooth-likelayoutbecomesapparentinthiscase,wecallthisapproach ‘saw-tooth’. Fig.5illustratesthis. Thesaw-toothpatterncontains onlytheredtriangles,whereas thefull-strippatterncontains boththeredandbluetriangles.

Wenowdetailthesetwooptions,assumingthattheboundarydatahasbeenmadecompatibleforG1 conditionsbythe boundaryadjustmenttechniquedescribedinSection 4.

5.2. Full-strip

Inthefull-stripoption,weconvertall2-connectedtrianglesintocompleteShirman-Séquinsplines.Thisrequirestheuse oftheCK-methodonallthreemacro-edgesofeach triangle,includingthesideincidenttotheB-repedge.Thissamestep

(10)

Fig. 5. Aschematicviewofthe1-connected(lightanddarkblue)and2-connected(lightanddarkred)macro-triangles.Thecontrolpointsofthecubic BéziercurvesformingtheapproximatedB-repedgearealsoshown.

isappliedtotheadjacentmicro-trianglesofan adjacentpatch,ontheothersideoftheB-repedge,andiftheysharetheir normaldata,G1continuityisensured.

The1-connectedtrianglesareonlypartlyconstructedusingtheShirman-Séquintechnique.Thisisbecausetheboundary data of the micro-triangles connecting to the ‘inner’ Clough-Tocher macro-elements can simply be degree elevated. All 1-connectedtrianglespossessamicro-triangle, shownindarkblueinFig.5,incidentwithaninnerClough-Tocher macro-element.Theothermicro-trianglesareshowninlightblue.

Andsofirst,allthedark-bluemicro-trianglesare partlycomputedusingtheClough-Tocher constructionuptothepart where the midpoints Qi,i+1 are determined (Section 3.4). At this point this data determines a fully C1 cross-boundary derivative andwe can degree elevate these data to quartic.Then the light-blue triangles are constructed usingthe CK-method as in the normal construction of a Shirman-Séquin macro-element. The degree elevation step ensures that the micro-triangle retains its C1 continuity across the macro-element boundary. In principle, it is also possible to use the alternativeG1 methodinstead,butthiswillchangethetypeofachievedcontinuityforthedarkbluemicro-triangles(Fig.5). 5.3. Saw-tooth

In the saw-tooth option,we want to minimise the numberof quartic triangles used, andso we only modify the 2-connectedtriangles,all othersare processedasClough-Tochermacro-elements.We canprocess the1-connectedtriangles asordinaryClough-Tocherelementsbecausetheonlyadjustmentmadetoitscontrolpointsinthenormaladjustmentstep respectsthegradientattheboundaryvertex.Thereforeall 1-connectedtrianglescanstillbeconnectedwithC1 continuity withall other 1-connected trianglesemanating fromthe samevertex. The 2-connectedtriangles should be processedas Shirman-Séquinmacro-elements,astheircontrolpointsmayhavebeenadjustedtocoincidewiththeB-repedge.

TheslightcomplicationhereisthattheCK-methodcannotbe appliedtoconnect thelight-redmicro-trianglesto their adjacentlight-blue triangles asthelatter onesdonot conform to thebasis patchconstruction. Therefore,the methodof Section5.1isusedtoconstructtheinnercontrolpointsofthelight-redmicro-triangles.

Theentireconstructionofthesaw-toothpatterncanbesummarisedasfollows.First,allClough-Tochermacro-elements are constructed asusual. Then only after this, we start with the construction of the Shirman-Séquin patches for all 2-connected triangles.For all macro-patchedges atthe B-rep edge (shownin darkred in Fig. 5) the standard CK-method is used.For all other edges (connection betweenlight-redandlight-blue triangles), a G1 connection ismade to the ac-tualadjacentcubicBéziertriangleoftheClough-Tochermacro-element.AfterthistheShirman-Séquinmacro-elementsare complete.

Wecanpushthissaw-toothoptionfurther,byinsistingthatonlythe2-connectedmicro-triangles(darkred)arequartic, all other remain cubic. This is possible by performing a secondary split, and we discussit briefly now for the sake of completeness.

5.4. Saw-tooth:secondarysplit

Inthisoption,wereplaceeach2-connectedmicro-trianglebyaShirman-Séquinmacro-element.

WefirstperformtheClough-Tochersplineconstructionasusual,butwedothiswithoutadjustingtheboundarycontrol pointstomaintainC1continuityawayfromtheB-repedge.Thenwereplacethe2-connectedmicro-triangleswith Shirman-Séquinmacro-elements.

Weproceedasfollows.First,wecannowsafelyadjusttheboundarycontrol pointstoensure C0 continuityacrossthe B-repedge.Now,themacro-edgesofthe2-connectedmicro-triangleareG1compatibleandwecanproceedbyapplyingthe

(11)

Fig. 6. Thefullconversionprocessandresults.Fromlefttoright:Inputtriangulation ofB-repmodel,thecontrolnetafterconversiontoacomposite Clough-TocherandShirman-Séquintriangularsplineusingthesaw-toothtechnique,smoothshadingandreflectionlinesontheresult,andavisualisation oftheerrorwithrespecttotheoriginalB-repmodel(blueiszeroerrorandredisglobalerrormaximumof0.00018168 relativetotheunitboundingbox diagonal.).Thecolourofthecontrolnetssignifiesthemethodusedtocalculatethecontroldata.PurplecorrespondstotheClough-Tochermethod,blueto themethodofChiyokura&Kimura,andredtothealternativeG1methodpresentedinSection5.1.

Fig. 7. Acomparisononasimplemodelcomposedoftwosphereoctantshavingseparateparametrisations.Bothoctantshavebeenuniformlysampled using16 triangles.InthetoprowweshowPhongshadingandBéziercontrolnets,andinthebottomrowweshowthereflectionlinesontheoctantsafter conversion.Thecolourofthecontrolnetssignifiesthemethodusedtocalculatethecontroldata.PurplecorrespondstotheClough-Tochermethod,blueto themethodofChiyokura&Kimura,andredtothealternativeG1methodpresentedinSection5.1.

CK-methodforthemacro-patchboundariesandthemethodofSection5.1forG1joinswiththeadjacentmicro-trianglesof theinitialsplit.

In cornercaseswheretwoedges ofa singlemacro-triangle comefromB-repedges, i.e.,two ofits micro-trianglesare 2-connected, the common micro-triangle boundary also uses the CK-method. This is the case because potentially both ofthemacro-triangleboundariescanhaveshiftedcontrolpoints afterboundaryadjustment.Thisbehaviour canbeclearly observedinthecornersofthetwodifferentsphereoctantsdepictedinFig.7,fourthcolumn,andisdescribedinSection6.1. 6. Results

In thissection we presentseveralresultsto show thecapabilitiesofthe newconversion method;seeFig. 6.We also compare the results obtained usingthe three variants of the method: full-strip, saw-tooth, and secondary split. We use simpleandacademicexamplestoillustratethemethod,butalsomorecomplicatedCADmodelstoshowitsutility. 6.1. Sphereoctants

Inthisfirstexample,weconnecttwooctantsofasphere.Inthiscase,wedonothavetoresorttousingboundarynormal adjustmentasboththepositionsandthetangentplanesatthesampledverticesalongthecommonedgeareshared.

Although the two octants,their sampling, and their parametrisations are fullysymmetric,the gradients computedon the octantsatthesharedvertices donot agree.ThismeansthattheClough-Tocher construction,evenaftertheedge con-trol point adjustment(Kosinka andCashman, 2015), yields a C0 conversionresult only, ascan be clearly seenfrom the brokenreflectionlinesinthebottomleftimage inFig.7.Themaximumnormaldeviationbetweenthetwooctantsalong their sharededgeisapproximately2

.

65 degrees;thusthecompositeClough-Tocher surfacedoesnotmeetthe 0

.

1 degree toleranceofstandardCADsystems.

(12)

Fig. 8. ReflectionlinesonatrimmedNURBSpatch(partofacarmodel)convertedtoatriangularsplineusingtheClough-Tochervariantwithadditional gradientssampledatedgemidpoints.Toprow,lefttoright:TheinputtriangulationofthetrimmedNURBSpatch,Clough-Tocherpatches,Clough-Tocher patcheswiththeboundaryadjustmentofKosinkaandCashman(2015).Notethejumpsinreflectionslines,indicatingthattheadjustmentruinedsomeof theinternalC1continuity.Bottomrow,lefttoright:Full-strip,saw-toothandsecondarysplit;fullyG1variantsofourconversionmethod.

Fig. 9. ReflectionlinesontwotrimmedNURBSpatches(partofacarmodel)convertedtoatriangularsplineusingthestandardClough-Tochermethod. Toprow,lefttoright:AsmoothrenderingofthetrimmedNURBSpatches,Clough-TocherpatcheswiththeboundaryadjustmentofKosinkaandCashman (2015),Clough-TocherpatcheswithboundaryadjustmentofKosinkaandCashman(2015) andtriangulationshowingthedifferenceinnormalvector;blue indicatesnodeviationinnormalvectorandredindicateshighdeviation.Notethejumpsinreflectionslines,indicatingthattheadjustmentruinedinternal C1continuity.Bottomrow,lefttoright:Full-strip,saw-toothandsecondarysplit;fullyG1variantsofourconversionmethod.

Inorderto obtainaglobally G1 result, theconversionvariantspresentedin Section5are usedtomodify the Clough-Tocher(micro/macro-)trianglesnearthesharedB-repedge.Theexpected G1 continuityofthesplineisverifiedby theC0 continuityofthereflectionlinesacrossthesharededgeofthetwooctants,showninthebottomrowofFig.7.

6.2. Boundaryadjustment

Now,weinvestigatetheeffectsoftheboundarynormaladjustmentasdescribedinSection4.

First of all, we describe theways in which our boundary normaladjustment lets uspreserve internal G1 continuity within a single B-reppatch. A single patchofa carmodel isshowninFig. 8.We compareour G1 techniques tothe C0 strategyofKosinkaandCashman(2015).

C0 continuityisguaranteedbyadjustingthecontrolpoints ofthemacro-patchboundaryedgestomakethemcoincide withthoseoftheB-repedgeitself.Asdiscussedabove,ourtechniquesproceeddifferently,namelybyapplyingtheboundary normaladjustmentandensuringthatthetangentplaneofthetriangularsplinecontains thetangentoftheB-repedge.In thisway,C0 continuitycanbeachievedwithoutchangingthetangentplane attheB-repedgevertices,anditalsocreates thepossibilityofsatisfyingG1 continuityconditions,inourcasethroughtheuseofShirman-Séquinmacro-elements.

(13)

Fig. 10. Visualisationofthedifferencebetweennormalvectorsofneighbouringtrianglesofthesplinesurfacesalongtheirsharededges.Fromlefttoright, toptobottom:Clough-Tocherwithcontrolpointadjustment,Clough-Tocherwithcontrolpointadjustmentandnormaladjustment,saw-tooth Shirman-Séquinandsaw-toothShirman-Séquinwithnormaladjustment.TheoriginalClough-Tocherconstructionwasusedintheseexamples.

Table 1

Theapproximationerrorbetweena(denselytriangulated)CADmodelanditsapproximationwithtriangularsplines,usingdifferentmethodsatB-repedges. Allmodelshavebeenscaledtounitbounding-boxdiameter.

Torus Sphereoctant Wing F1

B-rep patches 1 1 4 90 Macro-triangles 64 16 586 3371 Clough-Tocher (1965) 0.003463607 0.00130592 0.000810265 0.0015180568 Full-strip 0.004289734 0.00130592 0.000690301 0.0015180568 Saw-tooth 0.004289734 0.00130592 0.000690301 0.0015180568 Secondary split 0.004291569 0.00130592 0.000810265 0.0015364898

In Fig. 8, we can see a single trimmed NURBS patch converted into a C1 Clough-Tocher spline using the variant of the algorithm that uses extra sampled mid-edge gradients (Kosinka and Cashman, 2015, Section 3.6).We apply the C0 adjustment ofKosinka andCashman (2015) andour threedifferent techniquesusing Shirman-Séquinmacro- and micro-elementswiththeboundarynormaladjustment.Havingusedtheboundaryadjustmentinthiscaseallowsustoguaranteea commontangentplanefortheB-repedgeandthemacro-elementswhichlieontheboundary.Inthiscase,ourmethodand its variantsshowlargeimprovementswithrespecttocontinuityandvisualqualityastheratherlarge trianglesconnected totheboundarynowconnectsmoothlytotheinternaltriangles,incontrasttothepureClough-Tochermethod.

Ourmethodsare alsoabletoachievesmooth resultsfortwopatchestrimmedalonga sharededge.InFig.9weshow one such situation,wherealongthewhole B-repedge thetangentplane ofthesampledsurface doesnotagree withthe tangentsofthecommonB-repedge.ThisleadstoG1 discontinuities(thatis,thetangentplanedoesnotvarycontinuously) across theedgewhen applyingtheC0 control pointadjustmentofKosinka andCashman (2015). Byapplyingthenormal adjustmentalong thecommonedge,acommontangentplane canbedeterminedforbothsplinesurfacesoneachside of theedge.ThentheShirman-Séquinmacro- andmicro-elementscanensureG1 continuity.

To emphasisethe necessityofthe normaladjustmentstep we visualisethedifferencesinangles betweenthe normal vectorsalongthecommonedgeofadjacenttrianglesintheresultingsplinesurfacesinFig.10.Ascanbeseen,thenormal adjustment step alreadyimprovesthe normalerror insome situations without resortingto the G1 methods. Forthe G1 methodwecanseethatwithouttheboundaryadjustmenttherearestillsomedefectspresentaroundB-repedges.Applying

(14)

Fig. 11. Achallengingexample:ReflectionlinesoverameetingpointofseveraltrimmedNURBSpatcheswhichhavebeenconvertedtotriangularsplines usingtheClough-Tochervariantwithadditionalgradientssampledatedgemidpoints.Toprow,lefttoright:ThesmoothrenderingofthetrimmedNURBS patches,Clough-TocherpatcheswiththeboundaryadjustmentofKosinkaandCashman(2015) andtriangulationshowingthedifferenceinnormalvector. Bottomrow,lefttoright:Thefull-strip,saw-tooth,andsecondary-splitvariantsofourmethod.

thenormaladjustmentfixesthisinnearlyallsituations.TheexceptionsaretheT-junctionswherethetwoemanatingB-rep edges ofthe individual corners expressdifferenttangent planes.The only waytosolve thisis to adjustthe B-rep edges themselves,asdiscussed inSection 4.1.In theexamplein Fig.10we respect theinput tangents, whichthus give riseto sharpcorners.

Withtheboundarynormaladjustmentwecanalsoguarantee G1 continuitybetweenseveraltrimmedCADpatches.In Fig.11weshowthesituationaroundaB-repvertexwhereseveraldifferenttrimmedNURBSpatchesmeet.

All the shownB-rep edges are marked assmooth andthe boundary normal adjustmenttechnique hasbeen used to guaranteethattheyallmeetwithtangent-planecontinuityatsharedvertices.Withoutthisadjustment,itisingeneral im-possibletoguaranteeG1continuity,butC0 continuityacrossB-repedgesandG1continuityinternallycanstillbesatisfied, asalreadydescribedabove.

As canbe seen inFig.11,the techniquesshow varying levelsofpreservation ofthe original C1 Clough-Tocherspline. The secondary-splitsaw-toothtechnique againshowsrapidlyvarying reflectionlinesaround thecentral vertex. Itis thus doubtfulwhethertheresultingsurfaceactuallyimproves,atleastvisually,onaC0 equivalentwhichachievesonly approxi-mateG1 continuity.Theothertwotechniques,full-stripandsaw-tooth,producebetterresultsinthiscase;observetheC0 reflectionlinesrunningacrosstheB-repedges.

Finally,Fig.6showstheresultofapplyingourconversionprocesstoafullCADmodel,inthiscasethatofacarcomposed of42 B-reppatches.Notethatforthegenerationoftheimagesinthisfigurethesaw-toothvariationwasused.

6.3. Approximationerror

Wehavealsolookedattheapproximationerrorofthethreemethods.Weareinterestedinthemaximumerrorbetween a denselytriangulatedrepresentation ofan input CADmodelandits approximationusing theoriginal Clough-Tocher ap-proximation(denoted CTo inKosinka andCashman (2015)),andthe full-strip,saw-tooth andsecondary-splittechniques. TheresultsarelistedinTable1.Thebasetriangulationofthesphereoctantandthetorus modelcontainonly64triangles each.WealsoincludeacomplexmodelofaFormula1frontwing(lastcolumn).Itsgenusis18;itcontainsasmanyas14 smallboltholesobtainedbytrimming(seetheinset),andseveralfilletpatches.

It is apparent that the approximation error remains approximately thesame even when using thenew G1 methods. Insome caseswe evenobservea lowerapproximation errorthanwiththemethodofKosinka andCashman (2015). This couldbeduetotheincreasedcontinuityinternally.AtB-repedgevertices,thetangentplanesoftheShirman-Séquin macro-elementsareco-planarwiththeactualsampledgradientsfromtheunderlyingNURBSpatches,andthismightmaketheG1 approximationattheseverticesclosertothe inputCADmodelthanthe C0 constructionofKosinka andCashman (2015). As the C0 construction makes only control points of adjacentpatches coincide, thisstep in generalchanges the normal vector(s).

Whenincreasingthenumberofsample points,i.e.,weincreasethedensityofthetriangulation,weobserveadecrease in approximation error.Table 2 showsthe approximation errors obtainedusing two differenttriangulations ofthe same B-repmodel.Weobserveadecreaseoftheapproximationerrorwhenusingeach ofthethreenewconstructions, andthe errorremainsapproximatelythesameaswhenusingtheordinaryClough-Tochermethod.

(15)

Table 2

Theapproximationerrorbetweena(denselytriangulated)CADmodelanditstwosplineapproximationsdifferingin trianglecounts,usingdifferentmethodsatB-repedges.Allmodelshavebeenscaledtounitbounding-boxdiameter.

B-rep patches 13 13 Macro-triangles 532 1420 Clough-Tocher (1965) 0.00050614754 0.00017790225 Full-strip 0.00050614754 0.00018168288 Saw-tooth 0.00080641346 0.00018168288 Secondary split 0.00050174044 0.0001821653 6.4. Performance

The additionofShirman-Séquinmacro-elementsonandaround theboundariesofthetrimmedpatchesmightincrease the computation time ofthe spline conversion process;the introduced macroelements are composed ofquartic Bézier trianglesasopposedtotheoriginalcubicsettingwiththeClough-Tocherelements.Wehavealreadyexploredthetrade-off betweencontinuityandvisualqualitybyintroducingthethreedifferentstrategiesattheboundaries.Thedifferentstrategies alsoaffecttheefficiencyofthemethods.Thefull-stripstrategyandthesecondary-splitstrategyarefullylocal,meaningthat theconstructionscanbecomputedfullyinparallelandarethereforeveryefficient.

For the saw-tooth strip strategy, the Shirman-Séquin elements cannot be constructed concurrently with the Clough-Tocherelementsastheirconstructiondependsontheirneighbouringmacro-elements.Inprincipleitshouldbepossibleto constructthemfullylocallybysupplyingparametricdataofadjacenttriangles.Thenitispossibletoconstructtheadjacent cross-boundarytangentfunctionsindependentlytoensureG1 continuity.

Wehavemeasuredtheperformanceoftheconstructionofthesplinesurfacesforalltheconsideredtechniques.The per-formancemeasurementsweredoneonthecarmesh(asshowninFig.6)consistingof42B-reppatches.TheB-reppatches havebeenfurthertriangulatedintoatotalof3233triangleswhichprovidethetopologyofthetriangularsplinesurfaces.On averagetheconstructionoftheordinaryClough-Tochersplinesurfacetook0.09235seconds,whereas0.121,0.108,and0.123 secondsweretheaveragesrecordedforthefull-strip,saw-tooth,andsecondarysplittechniques,respectively.Althoughthe newG1 methodsmayseemcomplexintheirconstructions,theydonothaveanysignificantoverheadwithrespecttoonly usingClough-Tochermacro-elements.

7. Discussion

Tofullybenefitfromthepresentedtechniques,the CADmodels needtosatisfycertain smoothnessconditions,orthey needtobe slightlyadjusted.Wesay‘slightly’hereasitisexpectedthatwhenanedgeismarkedas(ordeemed)smooth, the normalvectorson eitherside ofitare expectedtobe differentonly upto a toleranceoffered bythe CADsystemof choice.Thus,theB-repedgeanditsvicinityalreadysatisfyapproximateG1conditions.

IfmultipleB-repedgescrossorterminateatavertex,thenthetangentsoftheseedgeshavetolieinacommontangent plane. Evenwithleastsquaresapproximationofthenormal,itisgenerallyimpossibletoguarantee G1 continuitywithout havingtoadjusttheboundarycurvestoagreewiththenewnormal.

Insomeofourresults,itmayseemthat thereisverylittleimprovementovertheC0 methodofKosinkaandCashman (2015).Andvisuallyanderror-wise,thisiscertainlytrue.However,ourmethodensuresexactG1 continuityoftheresulting triangularsplines,evenforCADmodelsofarbitrarymanifoldtopology(encodedintheirB-reps).Thismeansthatourresults aresuitablefordirectuseinisogeometricanalysis.ThefactthatwedonotdirectlyprovideC1 results,but‘only’G1results, isnotanobstacle(GroisserandPeters,2015).

We havealsoinvestigatedthetriangularGregorypatch(Longhi,1985)asanalternative totheShirman-Séquin macro-element. However,thiselementdoesnot provideanyobviousadvantages apartfrombeingasingle triangularelementas opposedtobeingcomposedofthreemicro-triangles.Gregorypatchesarerational,whichunnecessarilycomplicatesthe cal-culationofderivativesandnormals.Moreover,accordingtoourexperiments,theyarevisuallynearlyindistinguishablefrom theShirman-Séquinmacro-elementsastheirboundaryconditionsarealsosetusingthemethodofChiyokura&Kimura.

The full-stripconversionstrategycausesthebiggestvisualchangescomparedtotheoriginalClough-Tocher approxima-tionamongthethreevariantsofourtechnique.Naturally,thisisbecauseitreplacesmoremacro-elementscomparedtothe other techniques,butitalsochangesmoreofthecross-boundarydata,whereasinthecaseofthesaw-toothvariantsmost of theoriginalcross-boundaryderivativesare respected.In somecases,thisproduces ratherdifferentsurfaces,which can

(16)

We have presented several methods to improve existing conversion techniques for converting trimmed CAD models into triangularspline surfaces. While existing methods offeronly C0 continuityacross generic B-rep edges, oursolution convertsawholeCADmodelintoa G1-continuoustriangularspline.Theresultsareanalysis-suitableandCAD-compatible approximations.

Allourtechniquesrequireanintermediatestepofboundarynormaladjustmentinwhichanewnormalvectorisfound andthedatanearB-repedgesismadeG1-compatible.

Thethree variantsofourmethodrelyon theShirman-Séquinmacro-elements.Theseareutilised eitheronafull strip of1- and2-connectedboundarytriangles(full-strip),on2-connectedtriangles(saw-tooth),oronlyon2-connected micro-triangles(secondarysplit).ThethreetechniqueshavevaryinglevelsofpreservationoftheoriginalClough-Tocherconversion. Thefull-stripvariantisthemostinvasive,followedbythereplacementof2-connectedmacro- andmicro- triangles.

The presented techniques are efficient as they only need to be applied around B-rep edges and are not much more intensivetocomputethantheordinaryClough-Tochertechniques.

Declarationofcompetinginterest

The authors declarethat they haveno known competingfinancial interests or personal relationships that could have appearedtoinfluencetheworkreportedinthispaper.

Acknowledgements

The car,wing, andF1 front wingCADmodelsused inthis paperhavebeen kindlyprovidedby International Techne-Group Ltd.The triangulationsandother sampleddatafromthesemodels havebeenobtainedusingCADfix(International TechneGroupLtd.,2019).AndwethankPieterBarendrechtforproof-readinganearlierversionofthismanuscript.

References

Busaryev,O.,Dey,T.K.,Levine,J.A.,2009.RepairingandmeshingimperfectshapeswithDelaunayrefinement.In:2009SIAM/ACMJointConference on GeometricandPhysicalModeling.SPM’09.ACM,NewYork,NY,USA,pp. 25–33.

Chiyokura,H.,Kimura,F.,1983.Designofsolidswithfree-formsurfaces.ACMSIGGRAPHComput.Graph. 17(3),289–298.

Clough,R.W.,Tocher,J.L.,1965.Finiteelementstiffnessmatricesforanalysisofplatesinbending.In:ConferenceonMatrixMethodsinStructuralMechanics. WrightPattersonAirForceBase,Ohio,pp. 515–545.

Cottrell,J.A.,Hughes,T.,Bazilevs,Y.,2009.IsogeometricAnalysis:TowardIntegrationofCADandFEA.JohnWiley&Sons.

Elber,G.,Kim,M.-S.,2014.Modelingbycomposition.In:2013SIAMConferenceonGeometricandPhysicalModeling.Comput.AidedDes. 46,200–204. Farin,G.,1982.AconstructionforvisualC1continuityofpolynomialsurfacepatches.Comput.Graph.ImageProcess. 20(3),272–282.

Farin,G.,1986.TriangularBernstein-Bézierpatches.Comput.AidedGeom.Des. 3(2),83–127.

Groisser,D.,Peters,J.,2015.MatchedGk-constructionsalwaysyieldCk-continuousisogeometricelements.Comput.AidedGeom.Des. 34,67–72. InternationalTechneGroupLtd.,CADfixversion12.0,www.iti-global.com/cadfix,2019.

Kallmann,M.,Bieri,H.,Thalmann,D.,2004.FullydynamicconstrainedDelaunaytriangulations.In:Brunnett,G.,Hamann,B.,Müller,H.,Linsen,L.(Eds.), GeometricModelingforScientificVisualization.SpringerBerlinHeidelberg,Berlin,Heidelberg,pp. 241–257.

Kosinka,J.,Cashman,T.J.,2015.WatertightconversionoftrimmedCADsurfacestoClough-Tochersplines.Comput.AidedGeom.Des. 37,25–41. Longhi,L.L.,1985.Interpolatingpatchesbetweencubicboundaries.Tech.Rep.UCB/CSD-87-313.EECSDepartment,UniversityofCalifornia,Berkeley. Marussig,B.,Hughes,T.J.R.,2018.Areviewoftrimminginisogeometricanalysis:challenges,dataexchangeandsimulationaspects.Arch.Comput.Methods

Eng. 25(4),1059–1127.

Massarwi,F.,vanSosin,B.,Elber,G.,2018.Untrimming:preciseconversionoftrimmed-surfacestotensor-productsurfaces.Comput.Graph. 70,80–91. Peters,J.,2002.Chapter8–geometriccontinuity.In:Farin,G.,Hoschek,J.,Kim,M.-S.(Eds.),HandbookofComputerAidedGeometricDesign.North-Holland,

Amsterdam,pp. 193–227.

Piegl,L.,Tiller,W.,1995.TheNURBSBook.Springer-VerlagBerlin.

Schumaker,L.L.,Speleers,H.,2010.Nonnegativitypreservingmacro-elementinterpolationofscattereddata.Comput.AidedGeom.Des. 27(3),245–261. Sederberg,T.W.,Finnigan,G.T.,Li,X.,Lin,H.,Ipson,H.,2008.WatertighttrimmedNURBS.ACMTrans.Graph. 27(3),79:1–79:8.

(17)

Sevilla,R.,Fernández-Méndez,S.,Huerta,A.,2011.NURBS-enhancedfiniteelementmethod(NEFEM).Arch.Comput.MethodsEng. 18(4),441–484. Shen,J.,Kosinka,J.,2016.ConversionofCADmodelstoloopsubdivisionsurfaces.In:Magalhaes,L.G.,Mantiuk,R.(Eds.),EG2016–Posters,theEurographics

Association.

Shen,J.,Kosinka,J.,Sabin,M.A.,Dodgson,N.A.,2014.ConversionoftrimmedNURBSsurfacestoCatmull-Clarksubdivisionsurfaces.Comput.AidedGeom. Des. 31(7),486–498.

Shen,J.,Busé,L.,Alliez,P.,Dodgson,N.,2016a.Aline/trimmedNURBSsurfaceintersectionalgorithmusingmatrixrepresentations.Comput.AidedGeom. Des. 48,1–16.

Shen,J.,Kosinka,J.,Sabin,M.,Dodgson,N.,2016b.ConvertingaCADmodelintoanon-uniformsubdivisionsurface.Comput.AidedGeom.Des. 48,17–35. Shirman,L.A.,Séquin,C.H.,1987.LocalsurfaceinterpolationwithBézierpatches.Comput.AidedGeom.Des. 4(4),279–295.

Shirman,L.A.,Séquin,C.H.,1991.LocalsurfaceinterpolationwithBézierpatches:errataandimprovements.Comput.AidedGeom.Des. 8(3),217–221. Tristano,J.R.,Owen,S.J.,Canann,S.A.,1998.AdvancingfrontsurfacemeshgenerationinparametricspaceusingaRiemanniansurfacedefinition.In:Proc.

7thInt.MeshingRoundtable,pp. 429–445.

Urick,B.,Marussig,B.,Cohen,E.,Crawford,R.H.,Hughes,T.J.,Riesenfeld,R.F.,2019.WatertightBooleanoperations:aframeworkforcreatingCAD-compatible gap-freeeditablesolidmodels.Comput.AidedDes. 115,147–160.

Referenties

GERELATEERDE DOCUMENTEN

These results on the Crab and Vela pulsar in gamma rays, as well as the indication for polarized gamma-ray emission from the Vela pulsar /49/ and the. variation of the hard

In the current study, we investigated whether patients who converted to BD showed more feelings of anger, irritability and antisocial and borderline personality traits than people

Hence, the ability for t he youngsters to control their own behaviour should ameliorate which in turn might improve adherence of the youngsters to therapy

As visitors wander around the vacant rooms of the show, entitled “Exhibition to be Constructed”, they have to imagine what might be standing (or sitting, or hanging or lying)

More than 70% of the municipalities and building corporations want to see the reasons for the training, the learning goals, the approach to the training, the working model, the

Very noticeable in Figure 3b is that the mean value of the intensity function is equal to the number of count divided by the time.. We did a check for this figure and all

It means that only a single Look-Locker readout is required for the acquisition of both labeled and control images, instead of separate pair-wise acquisitions, thereby reducing

In plaats van de berekening van een spline-benadering via een lokale-polynoomrepresentatie per deelinterval, kunnen we ook een basis kiezen in de ruimte M p,p−1 (∆) van splines