1
$\begingroup$

Hopefully you can see my intention from the images, but I'm just trying to make procedural line that will place a set amount of pillars equally distanced along a line, with larger pillars on the ends. I've got everything down but cannot seem to reliably delete the end points of the shorter pillars.

This is mostly my intention, but you can see the smaller pillars clipping the bigger ones on the end. I want those removed.

Here I've captured the endpoints of the original mesh line, and then tried to apply that as the selection to a delete geometry node, but it ends up deleting every point but the middle one. How do I fix this?

$\endgroup$
0

1 Answer 1

3
$\begingroup$

I cannot tell for sure what is the best way for you, because there are things in your nodetree that do not really make sense to me: why do you first resample the curve to a count of half the length, then store the endpoints of this curve, then convert it to a mesh, convert this part into points but take another part and subdivide it again and join it to the points?

There are several issues with this: first of all, having the points from the Mesh to Points node joined with a subdivided version of the mesh will result in duplicate points/vertices in those locations where the original points are.

Let's say you have a mesh line consisting of 3 vertices, start, end, one in the middle. When you subdivide it by Level 1, you get a mesh line with 5 vertices: the start, end, middle and two extra points, one between start and middle and one between middle and end.

If you join this mesh line with the original mesh line, you have 8 vertices: the start, end and middle are doubled.

In your case there are some more. Your resampled curve results in 5 points, the ones with index 0 and 4 get the attribute "start" set to true. Converting this curve to a mesh and then to points results likewise in 5 points, index 0 and 4 are "start" points.

Then you subdivide the mesh, resulting in a mesh line with 17 vertices. Index 0, 1, 2, 3 and 4 are lying in the same location as the original mesh. 0 and 4 are "start" points. Index 5 to 16 are the newly created vertices subdividing the mesh. 5 to 7 are the ones between 0 and 1, so they inherit the "start" from 0. 8 to 13 are the vertices between 1 and 3 and have no "start" attribute, whereas 14 to 16 have inherited the attribute from vertex 4.

Here is an overview of what you are creating in the top row of your nodetree up to the Join Geometry node:

nodetree function overview

I'm not quite sure why in your screenshot the middle one is still there, but I did not completely rebuild your nodetree and did not use the exact same values, so maybe there are differences somewhere. Even with your values I get a different number of (visible) pillars.

Now what I would have done - but that's because I do not understand the reason for your setup and don't know if it is necessary to make it that complicated - would simply be to first get a reasonable resample count for the curve to get as many points inbetween as you need, then get the Endpoint Selection node to separate the endpoint from the rest of the curve.

And without the need to store any attributes and not even converting the curve to a mesh and then points, you can simply use the Endpoint Selection result where it's true for the larger pillars, and the inverted result for the smaller pillars. Or you even use the result to scale the hight of the pillars etc.

Some examples below, but these are just a few, you can make this in different variations and it always depends what your exact goal is. I've left the resampling by half the curve's length at the beginning because I do not know if this is important and it makes no big differences for the examples (and I've used cylinders instead of cubes).

So, first this is a node tree where I use two different sized pillars like you, the endpoints get the larger ones with 3 m height via selecting them through the Endpoint Selection node, the points inbetween get smaller 2 m pillars by inverting the Endpoint Selection with a Boolean Math node set to Not:

using different cylinders

Or here is an example where you don't need separate in two pillar objects and have two Instance on Points nodes. I've set the base height of the Cylinder to 1 m, then plug the Endpoint Selection node in a Math node set to Multiply Add. I'm multiplying 1 with the selection and add 2, this gives me a value of 1×1 + 2 = 3 for the endpoints and 1×0 + 2 = 2 for the points inbetween. Plugging this into the Z of a Combine XYZ node and using it to scale the cylinders will give the same result as the previous nodetree with two different pillar objects:

scaling cylinders differently

Or if you want them to start all at the same height from the bottom and only be different heights at the top, you could instead of instancing a Cylinder simply instance a Mesh Circle (Fill Type other than None to get faces) on those points. Since the circle has no height, the Z scale does not have an immediate effect. But if you plug an Extrude Mesh after the Instance on Points node, the Offset Scale will be using the scale of the instances for the extrusion:

extruding mesh circles

You can also, if you want to instantiate other objects at the endpoints instead of scaling the existing object, use the following setup, where I use the endpoint selection to select the appropriate object from a group of instances:

pick instance from group

$\endgroup$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .