Odd bugs with Constructive Solid Geometry 2D

• mcmcclur
• Offline
• New Member
• Professor of Mathematics at UNC - Asheville
3 years 6 months ago #3490 by mcmcclur
I look forward to trying it - thanks!!
• mcmcclur
• Offline
• New Member
• Professor of Mathematics at UNC - Asheville
3 years 5 months ago #3504 by mcmcclur
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!!
3 years 3 days ago #3888
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 3 days ago #3889
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)
Code:
# Create splines for pt in ngpts: geo.Append(["spline3", *pt], leftdomain=0, rightdomain=1)

Best,
Matthias
3 years 3 days ago #3890
Gurh you are right. Thanks a bunch for the swift reply!!!
Time to create page: 0.178 seconds