Odd bugs with Constructive Solid Geometry 2D

8 months 1 week ago #3490 by mcmcclur
I look forward to trying it - thanks!!

Please Log in or Create an account to join the conversation.

8 months 9 hours 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!!

Please Log in or Create an account to join the conversation.

2 months 1 week ago #3888 by JanWesterdiep
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.
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()

Please Log in or Create an account to join the conversation.

2 months 1 week ago #3889 by matthiash
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)
# Create splines
for pt in ngpts:
    geo.Append(["spline3", *pt], leftdomain=0, rightdomain=1)

Best,
Matthias

Please Log in or Create an account to join the conversation.

2 months 1 week ago #3890 by JanWesterdiep
Gurh you are right. Thanks a bunch for the swift reply!!!

Please Log in or Create an account to join the conversation.

© 2019 Netgen/NGSolve