Previewing a Closed Curve in Rendered View as a Filled Region

Hi –

I am trying to figure out a way to get a closed, planar curve to show up in render view as a filled in region without converting it into a surface via Boundary Surface. This may not be possible. Motivation given below.

I have a definition which does the following:

  1. Split a rectangular surface using a ton of planar cutting curves. This outputs a list of trimmed planar surfaces, call it S.
  2. Uses a variety of algorithms to cull a subset of the trimmed surfaces, call it S'.
  3. Use a variety of algorithms to split S' into two groups, call them A and B.
  4. A is immediately sent to a custom preview and so all the trimmed surfaces in it show up as monochromatic filled regions in rendered view.
  5. B is not immediately rendered. Instead, it is sent to a section which, conceptually, masks each region with a “square wave” with adjustable frequency and duty cycle: think IBM logo. This is the section which I am working on optimizing right now. More details below, but first…

Here are some examples of the output with various settings for step 5.

Currently, the process for step 5 is:

  1. create a global collection of contour lines which are the width of the image, and spaced out according to the frequency parameter, f.
  2. Use each line as the base of a rectangle a duty cycle parameter d to create a rectangle whose height is a percentage of the distance to the the next contour line. Call this collection of rectangles R
  3. For each trimmed surface in set B, calculate its intersection with R using Brep | Brep. This outputs a collection of closed curves (aka the “IBM logo effect”) for that region. This could possibly be optimized by not running the intersection on the entire set of rectangles R but only ones with relevant min/max values for the bounds for the upper and lower bounds of the currently processed surface. Call the entire set of closed curves generated from this process C
  4. Convert each closed curve in C into a surface using Boundary Surface so that it will show up in Rendered view as a black region. This is the step which I want to optimize, since it is the slowest step of the entire definition and also seems overly complicated for the desired result.

Each element in C is necessarily a closed planar curve. It seems to me that there must be a way to get a closed, planar curve to render as a filled in region in the viewport when sent to custom preview that doesn’t require the computational complexity of running them all through boundary surface. I am dealing with hundreds or sometimes thousands of these closed curves, and so Boundary Surface can take over a second to run, whereas the rest of the entire algorithm takes less than half a second.

Essentially, I would like to show a collection of closed planar curves (like those below) in render view as filled regions without first converting them to surfaces via boundary surface (since I am actually doing this for hundreds or thousands of curves.

Is there something trivial I am missing?

The entire algorithm should be pretty much real time, or close to it, and this is currently the major hurdle.

Will hatches work?

1 Like