# Unable to convert lines to dendro volume

I am trying to convert magnetic field based lines to dendro volume but getting the following error

Solution exception:Object reference not set to an instance of an object.

However, when I input some circles, the volume comes out to be absolutely fine with the exact same settings.

What is wrong with my lines and how can I fix this issue? I don’t want to use mesh pipes as dendro volume allows blending of pipes into each other in contrast to mesh pipes.
DENDRO VOLUME QUESTION.gh (1.3 MB)

This is a known error in Dendro in which a curve going into the Curve To Volume component is shorter than the Curve Radius input. You can fix it by culling any curves shorter than the Curve Radius from the input.

1 Like

Thanks a lot. Some more queries regarding dendro volume. How can I make the resultant volume smoother? It has undulations as compared to a scenario when I create a mesh pipe.

Another thing. How can I make the volume grow above the white surface and not pierce it?

Here’s what’s happening if I draw a rough section. The red circles are the pipes, the rectangle is the white shell.

How can I get this instead?

Offset your surface first by the radius, or offset your field lines normal to the surface. Rather than converting the lines to volumes, you can divide them into points yourself with a higher density, then convert the points to volumes. This is likely what the volume from curve component does anyway. For example you could divide by less than sphere radius to get smooth lines.

Pseudocode

1. Measure the length of the curve
2. Divide the length by the smallest dimension you’d like to capture
3. Round up to the ceiling
4. Divide curve by number
5. Get brep closest point
7. Add the normal to each point
8. Feed the points into the dendro volume from point

This should also get rid of your initial problem, because if you divide a curve by 1 the result is both end points. You’ll get a lot of points doing it this way, but it should be a lot smoother. You can also smooth the dendro volume

1 Like

Then I’ll have to generate the lines from scratch again by simulating the agents on the offset surface. Right?

I am getting the error “Data conversion failed from Mesh to Brep” in Brep closest point as it doesn’t support meshes.

The component Mesh closest point does not have a normal output that I can use to offset the points.

What do I do now?

DENDRO VOLUME OFFSET QUERY.gh (1.3 MB)

dharman is correct, the Curve to Volume component in Dendro simply generates points from input curves internally. Generating your own points then using Point to Volume will give you more control.

For smoothing your final volume, just decrease your Voxel Size and (optionally) add a Smooth Volume component. You can see the sample files and documentation included with Dendro fro more information on that.

To get your offset points you can use another Dendro loop that applies a Volume Offset to your base mesh that is 1/2 the point radius you use later (then mesh closest point from that output).
If you are trying to maintain the exact look of your source curves you can continue on and generate vectors from the original and new CP points.

1 Like

I am not able to understand this. Can you please share the script in which you did the modification? That would be really helpful.