What’s New in Geometry

Jaebum Jung, Wolfram Research

(RowDefault[, (Spacer1), , (Spacer1), ])  #WolframTechConf

ABSTRACT

In this talk, we will explore recent advances in geometric modeling and computation within Mathematica, covering new region modeling techniques, geodesic and surface curvature computations, and new mesh processing functionality like smoothing and decimation, coming in future releases.

Computational Geometry

Extensive collection of state-of-the-art geometric algorithms

Analyze and understand spatial structures

Computational Geometry

Geometry with Filled Curves and Joined Curves

Filled curves and joined curves work just like any other region

Deeply integrated in the Wolfram Language

a={{-1,0},{0,1},{1,0}};b={{0,-(2/3)},{-1,0}};

joinedcurve=Region[JoinedCurve[{BezierCurve[a],Line[b]}]]

ArcLength[joinedcurve]

filledcurve=Region[FilledCurve[{BezierCurve[a],Line[b]}]]

Area[filledcurve]

Computational Geometry

Geodesic Computation

Computation of geodesic and distance on regions

RegionDistance

GeodesicCurve - yield a geodesic curve of a region between two points on a region

GeodesicDistance - give the geodesic distance between two points on a region

Computational Geometry

Geodesic Computation

Computation of geodesic and distance on regions

reg=;

geodesic=GeodesicCurve[reg, 365, 900]

Show[{reg,Graphics3D[{Red,Thick, geodesic}]}]

GeodesicDistance[reg, 365,900]

Computational Geometry

Curvatures

compute curvatures of the given surface:

RegionGaussianCurvature - Gaussian curvature of the surface at the point

RegionMeanCurvature - Mean curvature of the surface at the point

RegionMinimumCurvature - Minimum curvature of the surface at the point

RegionMaximumCurvature - Maximum curvature of the surface at the point

reg=ExampleData[{"Geometry3D","Triceratops"},"MeshRegion"];

RegionGaussianCurvature[reg, 1]

RegionGaussianCurvature[reg, MeshCoordinates[reg][[1]]]

gcurv=RegionGaussianCurvature[reg, "MeshCoordinates"];
meancurv=RegionMeanCurvature[reg, "MeshCoordinates"];
mincurv=RegionMinimumCurvature[reg, "MeshCoordinates"];
maxcurv=RegionMaximumCurvature[reg, "MeshCoordinates"];

Multicolumn[Panel@Labeled[MeshRegion[reg, VertexColors->Map[ColorData["TemperatureMap"],LogisticSigmoid[ 2#[[1]]]]], #[[2]], Top, FrameMargins->10]&/@Transpose[{{gcurv, meancurv, mincurv, maxcurv},{"Gaussian", "Mean", "Minimum", "Maximum"}}]]

Advanced Mesh Processing

Decimation – reduce the number of elements in a mesh

Smoothing – reduce noise and surface roughness

Remeshing – improve the shape and size of mesh elements

Subdivision – refine a mesh by subdividing elements

Advanced Mesh Processing

SimplifyMesh

reduce the number of elements in a mesh

reg=ResourceData["Stanford Bunny"]

SimplifyMesh[reg, 1000]

Multicolumn[Panel@Labeled[SimplifyMesh[reg, #[[1]], ImageSize->150], #[[2]], Top, FrameMargins->10]&/@Transpose[{{1000, 800, 400, 200},{1000, 800, 400, 200}}]]

Advanced Mesh Processing

SmoothMesh

smooth a mesh by removing noise

reg=BoundaryDiscretizeRegion[CSGRegion["Difference",{CSGRegion["Union",{Cuboid[{-10,-10,0},{10,10,40}],Cuboid[{-26,-10,0},{26,10,5}]}],CSGRegion["Union",{Cuboid[{-1,-12,30},{1,12,50}],Cylinder[{{-20,0,35},{20,0,35}},2],Cylinder[{{0,-20,25},{0,20,25}},7],Cylinder[{{-18,0,-1},{-18,0,12}},4],Cylinder[{{18,0,-1},{18,0,12}},4]}]}]]

SmoothMesh[reg]

Quiet@Multicolumn[Panel@Labeled[SmoothMesh[reg,"Explicit", #[[1]],False,ImageSize->150], #[[2]], Top, FrameMargins->10]&/@Transpose[{{5, 10, 20, 30},{5, 10, 20, 30}}]]

Multi-Paradigm Modeling

Model geometric regions using meshes

Constructive solid geometry, Implicit representation and more

Combine and transform regions to create new ones

Multi-Paradigm Modeling

Modeling Libraries

Readily usable standard parts for mechanical design.

Example 1

Design a plate:

GeometricModel/@{"MetricHexSocketHeadCapScrew","MetricHexagonThinNut","MetricPlainWasher"}

Get the model regions:

{sr,nr,wr}=#["Region"]&/@%

Combine model regions:

screw=CSGRegion[{Style[sr,],Style[Translate[wr,{0,0,5}],],Translate[Style[nr,],{0,0,12.4-5}]}]

screws=CSGRegion[Translate[screw,#]&/@Join@@Table[If[i===-1||i===1||j===-1||j===1,30{i,j,0},Nothing],{i,-1,1,1/2},{j,-1,1,1/2}]];
base=Cuboid[{-40,-40,0},{40,40,5}];
CSGRegion[{Style[base,],screws}]

Multi-Paradigm Modeling

CSGRegion

now support annotations (multi materials, general CAD part annotations, …)
Style . Annotation . Annotate . AnnotationKeys . AnnotationValue . AnnotationDelete . AnnotationRules

GraphicsRow[CSGRegion["Difference", {Style[#[1],],CSGRegion[{Style[#[0.8],],Style[Cube[{0,0,5},9.5],]}]}]&/@{Icosahedron,Dodecahedron,Octahedron}]

Specify custom annotation for child region:

csg=CSGRegion[{Ball[],Annotation[Cuboid[],"A"->100]}]

AnnotationValue[{csg,{2}},"A"]

Options[csg]

FilledCurve, BezierCurve – filled Bezier curves as CSG regions

pts={{0,1},{-1,-(1/2)},{1,-(1/2)}};

Region[FilledCurve[{{Line[2pts]},{Line[pts]}}]]

Region[CSGRegion["Intersection",{FilledCurve[{{Line[2pts]},{Line[pts]}}],Rectangle[]}]]

Multi-Paradigm Modeling

LinearExtrudedRegion

Extruding a 2D region along a straight line

br=BoundaryDiscretizeRegion[RandomPolygon[]]

LinearExtrudedRegion[br,1/2]

LinearExtrudedRegion[Rectangle[{1,2}],1/2]

LinearExtrudedRegion[Disk[],2]

Multi-Paradigm Modeling

Splines

Piecewise polynomial parametric curves or surfaces

Simplicity and accuracy of evaluation

Approximate complex shapes through curve fitting

Manipulate[Graphics[{Blue,BSplineCurve[pts,SplineDegree->3]}],{{pts,{{0,0},{1,1},{2,-1},{3,0},{4,-2},{5,1}}},{-2,-2},{2,2},Locator},AutorunSequencing->{{3,5},4,2}]

Modeling with Splines

BSplineCurve — NURB curve

BSplineSurface — NURB surface

BoundarySplineRegion — NURB region

cpts=Table[{i,j,RandomReal[{-1,1}]},{i,5},{j,5}];
b=Graphics3D[{Opacity[0.6],BSplineSurface[cpts]}];
Show[Graphics3D[{PointSize[Medium],Red,Map[Point,cpts],Gray,Line[cpts],Line[Transpose[cpts]]}],b,Boxed->False]

Explore Modeling with the Constructive Solid Geometry Library
Wednesday  11 : 30  PM  CDT

Office Hour: Discrete Computation
Friday  3 : 00  PM  CDT

subscribe to Wolfram R&D
(HyperlinkURL["\!\(\*StyleBox[\"https\",FontSize->24]\)\!\(\*StyleBox[\":\",FontSize->24]\)\!\(\*StyleBox[\"//\",FontSize->24]\)\!\(\*StyleBox[\"www\",FontSize->24]\)\!\(\*StyleBox[\".\",FontSize->24]\)\!\(\*StyleBox[\"youtube\",FontSize->24]\)\!\(\*StyleBox[\".\",FontSize->24]\)\!\(\*StyleBox[\"com\",FontSize->24]\)\!\(\*StyleBox[\"/@\",FontSize->24]\)\!\(\*StyleBox[\"WolframRD\",FontSize->24]\)", https://www.youtube.com/@WolframRD])

(RowDefault[, (Spacer1), , (Spacer1), ])  #WolframTechConf