PolyCurve.ByJoinedCurves outputs null after Geometry.Intersect?

So I’m trying to smooth contours which will smooth out the topography. I realize I could probably use the MeshToolkit, but this graph seemed like it would work as well as teaching me a great deal about Dynamo, except I’m encountering many errors.

Here is the graph that I’m using and changing to make it work with my topography.

This one, I just can’t seen to get past. It’s in the middle of the graph. Took the toposurface, converted it to a polysurface, then created a bounding box and planes to intersect the geometry. The Geometry.Intersect is intersecting the planes from Plane.ByOriginNormal and the polysurface. But as you can see when trying to join the curves, it outputs a null. I assume this is because the list created from the Geometry.Intersect doesn’t just have lines but surfaces within it too. So I thought to explode the geometry that was intersected and remove the “Surface” items from the list then feed that into the PolyCurve.ByJoinedCurves. Then it would only have curves to join and should join them to how it’s expected. But that’s also not working. The node at the top that is cut off is the Geometry.Explode node. and this is the error from the polycurve node “Warning: One or more of the input types are not matching. Couldn’t find a version of ByJoinedCurves that takes arguments of type (__array)” The nodes that follow the polycurve node seem to not be working because the polycurve node is returning null.

I have also tried using the Flatten node after Geometry.Intersect, and it doesn’t help.

Here is the picture of the section in my graph.

Any help would be appreciated. Thanks.

OP here

Another weird thing is that the Geometry Intersect gets an error when the increment number that feeds into the Plane.ByOriginNormal (which ends up being the vectorToAdd in Point.Add) which feeds into the origin of the Plane.ByOriginNormal node is lower than 3. I’m at a loss with this one also.

Another side note: There are red rectangular boxes that go across areas of the topograpy which I think are there because of Dynamo. All of these locations seem to be areas where the toposurface isn’t solid due to building pads.

Hi,

First, I don’t think that the top right nodes will run as you expect because in the List.Contains node, you are searching for a string in a list of Geometry objects.

Could you please show the output of the Geometry.intersect node please ?

The watch node right to the right of the Geometry.intersect node shows the output of it. It is a list of all the lines created form the Geometry.intersect node and surfaces as well for some reason. It’s intersecting a polysurface with planes so shouldn’t that only create lines?

And what would you suggest to remove the surfaces from the list?

Edit: Spelling

Oh right sorry, did not saw it :frowning:

Regarding your question about the intersection, I think it might depend on the definition of your PolySurface. If the Surfaces you are intersecting it with are contained in the PolySurface itself, it is not alarming that you get Surfaces in the intersection. In any other cases, I also think that you should only get Lines.

To remove the Surfaces, you can convert the type of the Elements in strings, compare the list obtained with Autodesk.DesignScript.Geometry.Surface, and then apply a List.FilterByBoolMask.

I’ll try what you suggested for sure, but it’ll be after my lunch break. I will respond with what happens. Also do you think I need to explode the output of the geometry.intersect node?

I don’t think so, as with Lines you will probably just get the same output as the input.

If there is still an error, try to make sure that the curves you are trying to connect truly share points. Sometimes, a little imprecision in the computation of the intersection will result in Dynamo creating two points almost equal, but not truly equal.

What you suggested worked! Though I also had to send the list through another filter to remove “Solid” which were at the very front and end of the list. I’m not sure why the solids were part of the list though.

Any reason why If I retrieve endpoints from a curve, later on in the graph, using Curve.EndPoint, that NurbsCurve.ByPoints doesn’t work. It gives me this “Warning: NurbsCurve.ByPoints operation failed.
NurbsCurves require at least 2 points for interpolation”

Probably a problem about your list level. NurbsCurve.ByPoint may return this error if it is fed only one point. Try flattening your list at some point (I have not access to your project unfortunately, so I can help you here on where to get hings done).

I got the graph to work, it’s just not working in the intended way. I made another post to it, where I uploaded the file of the graph. However, I’m not exactly sure how to upload a file to here.