mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-26 12:50:34 +05:00
updated 2D examples
This commit is contained in:
parent
eeac7442f3
commit
43b0054c54
@ -1,10 +1,5 @@
|
||||
from nglib.meshing import *
|
||||
from nglib.geom2d import *
|
||||
|
||||
geom = SplineGeometry()
|
||||
SplineGeometry.Plot = plotgeom
|
||||
SplineGeometry.ShowPoints = plotpointindex
|
||||
SplineGeometry.ShowDomains = plotdomainindex
|
||||
|
||||
# Define Points
|
||||
pi1 = geom.AppendPoint(0,0)
|
||||
@ -13,10 +8,10 @@ pi3 = geom.AppendPoint(1,1)
|
||||
pi4 = geom.AppendPoint(0,1)
|
||||
|
||||
# Define Segments
|
||||
geom.AppendSegment(pi1,pi2)
|
||||
geom.AppendSegment(pi2,pi3)
|
||||
geom.AppendSegment(pi3,pi4)
|
||||
geom.AppendSegment(pi4,pi1)
|
||||
geom.AppendSegment([pi1,pi2])
|
||||
geom.AppendSegment([pi2,pi3])
|
||||
geom.AppendSegment([pi3,pi4])
|
||||
geom.AppendSegment([pi4,pi1])
|
||||
|
||||
# Plot Geometry
|
||||
geom.Plot()
|
||||
|
@ -1,10 +1,5 @@
|
||||
from nglib.meshing import *
|
||||
from nglib.geom2d import *
|
||||
|
||||
geom = SplineGeometry()
|
||||
SplineGeometry.Plot = plotgeom
|
||||
SplineGeometry.ShowPoints = plotpointindex
|
||||
SplineGeometry.ShowDomains = plotdomainindex
|
||||
|
||||
# Define Points
|
||||
pi1 = geom.AppendPoint(0,0)
|
||||
@ -15,11 +10,11 @@ pi5 = geom.AppendPoint(0.5,1)
|
||||
pi6 = geom.AppendPoint(0,1)
|
||||
|
||||
# Define Segments
|
||||
geom.AppendSegment(pi1,pi2)
|
||||
geom.AppendSegment(pi2,pi3)
|
||||
geom.AppendSegment(pi3,pi4,pi5)
|
||||
geom.AppendSegment(pi5,pi6)
|
||||
geom.AppendSegment(pi6,pi1)
|
||||
geom.Append(Line(pi1,pi2))
|
||||
geom.Append(Line(pi2,pi3))
|
||||
geom.Append(Spline3(pi3,pi4,pi5))
|
||||
geom.Append(Line(pi5,pi6))
|
||||
geom.Append(Line(pi6,pi1))
|
||||
|
||||
# Plot Geometry
|
||||
geom.Plot()
|
||||
@ -29,6 +24,10 @@ geom.ShowPoints()
|
||||
# Plot Domain Numbers
|
||||
geom.ShowDomains()
|
||||
|
||||
# Hide point indices and domain numbers
|
||||
geom.ShowPoints(False)
|
||||
geom.ShowDomains(False)
|
||||
|
||||
# Set Meshing Parameters
|
||||
mparam = MeshingParameters()
|
||||
mparam.maxh = 0.1
|
||||
|
Loading…
Reference in New Issue
Block a user