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:
- Split a rectangular surface using a ton of planar cutting curves. This outputs a list of trimmed planar surfaces, call it
- Uses a variety of algorithms to cull a subset of the trimmed surfaces, call it
- Use a variety of algorithms to split
S'into two groups, call them
Ais immediately sent to a custom preview and so all the trimmed surfaces in it show up as monochromatic filled regions in
Bis 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:
- create a global collection of contour lines which are the width of the image, and spaced out according to the frequency parameter,
- Use each line as the base of a rectangle a duty cycle parameter
dto create a rectangle whose height is a percentage of the distance to the the next contour line. Call this collection of rectangles
- For each trimmed surface in set
B, calculate its intersection with
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
Rbut 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
- Convert each closed curve in
Cinto a surface using
Boundary Surfaceso 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.