Filtering workflow based on curve properties

I am new to GH and I’m learning this for work. My ultimate goal is to create a custom fabrication drawing workflow for our company. Maybe I’m shooting myself in the foot. But I am creating a script that will provide angular dimension annotations since the GH component is so limiting. I decided it would be a good idea to normalize the vectors of all curve inputs so that the dimensions logic is simpler, and so that my users can import autocad DXFs of various quality to rhino and get the fabrication drawing logic to work the same.

I created 5 curves with various winding, 2d vs 3d, and open vs closed, and polyline vs line segments. My normalization logic works on each 1 at a time. So the 3d projecting to 2d works if I select 3d curves only. My open vs closed logic only works when I select one or the other. If I select multiple types of curves then the logic falls apart and only the first index in the list gets solved.

I feel like I’m missing something simple on either parsing the input more or in my gate logic. How can I change the input of some of the nodes to parse each curve as its own entity going through the nodes?

panel_builder.gh (26.0 KB)

Hi Eliot,

When posting the gh file and not including the Rhino file you can internalize the geometry like so..

What is the ideal workflow and what is the input (dxf file w/ 3d curves?)

Thank you for the tip. I will include that next time I upload the .gh.

We manufacture panels of different materials and some of them have some complex shapes(for panels). There was an attempt started ~10 years ago to make Revit the manufacturing authoring environment. But, they couldn’t do it so every Revit panel gets exported and touched up into autocad. Which then creates this overly complex design process. Because Revit sucks, sometimes the line geometry in autocad has Z values other than 0. Or line segments that aren’t connected. This doesn’t affect the autocad part of because of any number of workarounds that have been created, but the goal is to migrate design process to Rhino.

I want to export the line geometry in autocad (see attached) into Rhino, and allow the user to select all lines on Layer X as the input curves for the grasshopper script. Then no matter how the panel profile was created / exported, the vectors of each line segment get normalized into a CCW winding so that I can apply dimensions, curve offsets, and create cutlists for existing projects. And create the actual 3d representation of below.

To me it made sense to normalize all line segments so that I could just flip the start and endpoints of 1 vector if I need to get interior angles. And to make it a reliable detection of if the centeroid of a polygon is within the curve then I can use a simple workflow to generate geometry, or if it lies outside the curve then I have some complex “L” or “C” shape that would need a slightly more complex workflow.

Hopefully I didn’t make it more confusing.

I worked on aluminium panels algorithm like that, few years ago. We had C, L and more complex panels with bends on bends, and bends on multiple sides (for corner panels that should come to the roof, or panels going around windows), and lots of different complicated trims. I can not post any files, but It is definitely possible to make what you want, if you want some advice on that you can text me.

Can you post an example dxf/dwg?

Lets start with one part and work from there. Your discussion is not very easy to follow, so if we look at the problem step by step you are bound to get more help. Could you import your CAD data into a .3dm file that can be shared? I for one cannot make out much about the parts. The basic problem sounds like you need to fix the seam location of a closed polyline. How the user selects the bounding lines will make a difference in all of this.

In these workflows in general i’m a big fan of pre-processing. Typically by attaching usertext to isolate the commons and the outliers.

I will reach out with a DM, thank you Dfytz1.

@Brad_Shipton Yeah, fair point. I provided to much about the grand problem, when the problem this post is about really boils down to wanting to make each panel profile to be 2d only, and have vectors for each line segment follow a CCW winding. And if the polyline is not closed after Join Curve, then put a text label on the polyline.

I have 9 designers, and sometimes they draw the polylines CW, sometimes they draw them as multiple line segments snapped together. Sometimes they draw a polyline CCW, explode it, move each segment to a different layer and then they export 3 of the 4 lines that make up a panel profile. I’m trying to build in some QC checks.

@Japhy In my mind my attempt to make the input curves CCW polylines was pre-processing. Is this not what you are referring to?

I’ve cleaned up and attached the DXF of the autocad image above. Technically every curve is not closed. The vectors of the line segments do not follow a CW or CCW rule for every panel. One of the line segments has a non-zero Z value. And each profile outline exists on multiple layers(solvable with my autocad export plugin).

Drawing2.dxf (129.1 KB)

I appreciate the discussion so far! The 3dm is here. It contains both the DXF from above, as well as the geometry from the OP screenshot.

test_curves.3dm (55.4 KB)

I understand the drafting issue.

If you want the Z value to be 0 always and you are dealing with linework other than 3D polylines, you can easily select all the linework in CAD and change the value to 0. You can do that with 3D polylines as well, but you need to select each point one by one if I recall correctly.

Another step is to use the OVERKILL function in CAD to get rid of overlapping lines or other jibberish.

All of this can be done in GH as well, but I think you can make a more robust script without dealing with these problems.

I see you have a weld path layer. I assume that is to be a separate entity.

I fixed some of the geometry in CAD before re-importing. After that I joined the curves in GH and flipped the curves based on a guide. There are many other ways depending on your geometry problems. This will not work very well if curves are not joined.

If the CW v CCW is important for some reason, I suggest trying to train staff. We do a lot of modeling in 3D and it is very important for many of our parts. If you are drafting in 2D and techs are getting points in Z elevation that suggests you have a very poor tech. We work with Civil drawings and I see that all the time. They get the drawing to look good in plan, but if you rotate to see a perspective view, you see endless garbage. That is fine for some, but if you CAD files are being used downstream to make things, that is just not acceptable. It usually leads to errors that cost $$.

Not sure this helps, but I toook a look.

Good luck.

LINES.gh (9.7 KB)

test_curves.3dm (96.5 KB)

1 Like