artem-ogre / PythonCDT

Constrained Delaunay Triangulation (Python)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upgrade to PythonCDT to use the latest version of CDT?

jreniel opened this issue · comments

Hi there @artem-ogre,

First, I'd like to say that this package essentially saved my a**. I have been working with some special kinds of triangulations for geophysical domains, but it was nearly impossible for me to find a triangulator that would both respect the constraints and be conforming at the same time. Literally, I almost gave up at some point. After one last ditch Google search I found this package and it literally saved my entire project. Needless to say, I'm extremely grateful for this contribution.
Which takes me to my question, is there any chance that you would upgrade the core CDT on PythonCDT?
This one works well, but it would be nice to have this package keep up with the core CDT if possible.
Would that be doable?
Also, I'm unclear on how to cite you for this, do you have a particular peer-reviewed publication you'd like me to use as reference when describing the parts of my workflow that use CDT?
Thanks again!

Hi, @jreniel
Thanks for the kind words, it means a lot to me 😊. Bumping the CDT version is rather straight forward, please check out the branch, play with it, let me know if you have any issues, suggestions, improvements (e.g., more/better tests). I will be grateful for any help as I have very little spare time at the current stage of my life :)

Thanks for putting this together so quickly!
I will test and let you know.
To give you a quick overview of what's going on, I am using PythonCDT in tandem with jigsawpy and a custom quadrilateral generation algorithm. In particular, I use JIGSAW to generate a base isotropic mesh, then I generate a complex of quadrilateral, then I splice the base mesh with the quads using CDT. I need to use JIGSAW because CDT won't add points in the interior of the domain (plus JIGSAW treats the PSLG differently than the way CDT treats it), so I essentially have a hybrid system between the two.

One thing I can say is that the auto cleanup holes didn't work as expected, so I had to implement a custom cleanup solution. CDT thinks my quads are supposed to be holes, but not exactly. It's OK as my custom cleaning does the trick! Also, sometimes CDT generates collapsed triangles, but again, overall I was able to make everything work in the end and I couldn't have done it without using the CDT core.

will test your new branch soon, thanks again!

Thanks fore the details. Can you provide example inputs that reproduce the problem with holes removal and collapsed triangles? What do you mean by the collapsed triangles?

A perfect reproducer consists of three parts: input data, how CDT API is called, what is a desired outcome.

Also, there’s an open PR implementing Ruppert refinement in CDT. Will it help with adding points in the interior of the domain?

Thanks for your interest in this topic. For the holes removal "issue", I can later on come up with an example, but I might be a bit tied up at the moment to provide one immediately. However, since I can see you have genuine interest, I will follow up.

With respect to the interior points, I'm afraid in my case Ruppert's algorithm is not sufficient. The reason is that we're not adding points just as "fillers", but we're using a scalar size function to dictate the node density on specific areas. For example, if you need to "delineate" the shoreline, you'd have a scalar size function for this. However, this doesn't mean that Ruppert's algorithm is not a desirable property on CDT, I'm sure that with the implementation of RA, we can come up with other types of workflows, and probably other kinds of meshes that would be useful for us.

And finally, wrt to collapsed triangles, think about 3 points that are collinear, but end up being a "flat" triangle. I actually get tons of these, particularly at the boundaries, but then I do another step to remove them. I am working with very large datasets, and there's many parts to my workflow, which is why it's not always easy for me to just extract the parts that are problematic, plus I'm writing my dissertation at the same time, while getting divorced and taking care of my son, so I have plenty on my plate right now! But we'll keep this up. I appreciate very much all this exchange and I'm grateful that this package was published and allowed me to survive my PhD.

Also, don't forget to let me know how to properly reference you in my writings!

Thanks!
-J.