Wolfram Geometric Computation | Things to Try
Wolfram Geometric Computation | Things to Try
Make edits and run any piece of code by clicking inside the code and pressing .
+
Geometric Modeling & Computing. Wolfram Geometry provides a comprehensive set of integrated tools and solutions for modeling, analyzing, visualizing and synthesizing geometry, tailored to everyone’s needs from beginners to advanced.
Generate and Use Mesh Regions
Generate and Use Mesh Regions
Create a 3D mesh using built-in functions: |
mesh=MengerMesh[2,3]
Compute a region measure of the mesh: |
SurfaceArea[mesh]
Compute another: |
Volume[mesh]
Use the mesh as the domain of numerical computations: |
Integrate[yz,{x,y,z}∈mesh]
Compute meshes from points: |
SeedRandom[1324];points=RandomReal[{-1,1},{20,2}];{VoronoiMesh[points,Epilog{Red,Point[points]}],DelaunayMesh[points,Epilog{Red,Point[points]}]}
Compute Properties of a Geometric Region
Compute Properties of a Geometric Region
Import a region (this may take longer to evaluate): |
In[]:=
physicalregion=ResourceData["Stanford Dragon"]
Compute the rotational inertia of this region about its centroid (assuming unit density): |
In[]:=
ℐ=MomentOfInertia[physicalregion];
Compute the centroid, principal axes and principal moments of inertia of this region: |
In[]:=
center=RegionCentroid[physicalregion];principalAxes=Eigenvectors[ℐ];principalMoments=Eigenvalues[ℐ];
Visualize the region with principal axes scaled according to their eigenvalues: |
In[]:=
Show[physicalregion,Graphics3D[MapThread[{#1,Arrowheads[{-0.05`,0.05`}],Arrow[Tube[{-#2,#2}#30.5`+Threaded[center]]]}&,{{Red,Blue,Green},principalAxes,Normalize[principalMoments]}]]]
Out[]=
Solve Over Regions
Solve Over Regions
Define a set of geometric primitives: |
In[]:=
primitives={Cuboid[{-3,-3,-.1},{3,3,.1}],Cylinder[{{-3,0,0},{3,0,0}},1],Cylinder[{{0,-3,0},{0,3,0}},1],Cylinder[{{0,0,-2},{0,0,2}},1]};
Use the primitives to define a constructive solid geometric region: |
In[]:=
csgregion=CSGRegion["Difference",{CSGRegion["Union",Most[primitives]],Last[primitives]}]
Represent geometric regions in a variety of ways: |
In[]:=
booleanregion=BooleanRegion[(#1||#2||#3)&&!#4&,primitives];RegionConvert[booleanregion,"Implicit"]
Solve a differential equation to model temperature changes over this region: |
In[]:=
sol=NDSolveu[x,y,z,t]==3u[x,y,z,t],DirichletCondition[u[x,y,z,t]==1,{x==3,x==-3,y==3,y==-3}],DirichletCondition[u[x,y,z,t]==5,+==1],u[x,y,z,0]==3,u,{t,0,25},{x,y,z}∈booleanregion;
∂
t
2
∇
{x,y,z}
2
x
2
y
Visualize the solution at a particular time: |
In[]:=
SliceContourPlot3DEvaluate[u[x,y,z,25]/.sol],{"ZStackedPlanes",Range[-1,1,0.2]},{x,y,z}∈Cuboid[{-3,-3,-3},{3,3,3}],
Animate the numerical solution (this may take longer to evaluate): |
In[]:=
ListAnimateTableRasterizeSliceContourPlot3DEvaluate[u[x,y,z,t]/.sol],"CenterPlanes",{x,-3,3},{y,-3,3},{z,-3,3},,{t,0,5.,.1},ControlPlacement->Top
Import, Repair, Export and Print a 3D Model
Import, Repair, Export and Print a 3D Model
Import a 3D model: |
In[]:=
model=ResourceData["Stanford Bunny"]
Find the holes at the bottom of this mesh: |
In[]:=
FindMeshDefects[model,ViewPoint->{0.3,-1.3,-1.5}]
Repair the holes: |
In[]:=
repairedmodel=RepairMesh[model,ViewPoint->{0.3,-1.3,-1.5}]
Export the model to a file: |
In[]:=
Export["example.stl",repairedmodel]
Send the model to a 3D printing service: |
Printout3D[repairedmodel,"Sculpteo"]
Explore Synthetic Geometry
Explore Synthetic Geometry
Find a random instance of a scene described by geometric propositions: |
scene=RandomInstance[GeometricScene[{a,b,c,o},{Triangle[{a,b,c}],CircleThrough[{a,b,c},o],o==Midpoint[{a,c}]}]]
Explore conjectures associated with a scene’s known propositions: |
conjectures=FindGeometricConjectures[scene]
Obtain a list of conjectures associated with the specified scene: |
conjectures["Conclusions"]