Odd bugs with Constructive Solid Geometry 2D
3 years 10 months ago #3490
by mcmcclur
Replied by mcmcclur on topic Odd bugs with Constructive Solid Geometry 2D
I look forward to trying it - thanks!!
3 years 9 months ago #3504
by mcmcclur
Replied by mcmcclur on topic Odd bugs with Constructive Solid Geometry 2D
I wasn't able to get to this right away but I can confirm that this fixed all the problems I was having.
Thank you!!
Thank you!!
- JanWesterdiep
- Offline
- Junior Member
Less
More
- Thank you received: 0
3 years 4 months ago #3888
by JanWesterdiep
Replied by JanWesterdiep on topic Odd bugs with Constructive Solid Geometry 2D
Hello there, just to let you know I hit the same bug with the very simple MWE below. This is with NGSolve 6.2.210x with x=1,2,3,4.
Code:
import netgen.gui
from netgen.geom2d import SplineGeometry
geo = SplineGeometry()
# Control points for a (near-)circle drawn with quadratic rational splines
pts = [[(297.79, 347.97), (280.5658347837522, 348.1496523099468)],
[(280.47875, 366.16625000000005),
(280.39167008489085, 384.1818404370362)],
[(297.48, 384.52000000000004), (315.803620573473, 384.49016911587523)],
[(315.75124999999997, 366.35), (315.6988839573919, 348.211400289232)]]
# Create NGSolve point objects
ngpts = []
for pt in pts:
ngpts.append([geo.AppendPoint(*lopt) for lopt in pt])
# Connect the end point of every spline with the starting point of the next
for i, pt in enumerate(ngpts[:-1]):
ngpt.append(ngpts[i + 1][0])
ngpts[-1].append(ngpts[0][0])
# Create splines
for pt in ngpts:
geo.Append(["spline3", *pt])
# This crashes and prints "loclines.Size = 1" over and over.
geo.GenerateMesh()
3 years 4 months ago #3889
by matthiash
Replied by matthiash on topic Odd bugs with Constructive Solid Geometry 2D
You are having a different issue here (not using 2d CSG, but SplineGeometry).
Since you are passing the points in clockwise order, the mesher is meshing the outside (infinite) domain.
Either pass the points in counterclockwise order or define left/rightdomain (0 == dont mesh)
Best,
Matthias
Since you are passing the points in clockwise order, the mesher is meshing the outside (infinite) domain.
Either pass the points in counterclockwise order or define left/rightdomain (0 == dont mesh)
Code:
# Create splines
for pt in ngpts:
geo.Append(["spline3", *pt], leftdomain=0, rightdomain=1)
Best,
Matthias
- JanWesterdiep
- Offline
- Junior Member
Less
More
- Thank you received: 0
3 years 4 months ago #3890
by JanWesterdiep
Replied by JanWesterdiep on topic Odd bugs with Constructive Solid Geometry 2D
Gurh you are right. Thanks a bunch for the swift reply!!!
Time to create page: 0.140 seconds