Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
pattern in a cloud of points (around 2K/3K points or more)
otaolafr
Member Posts: 113 EDU
hello,
I want to create a pattern of solids in a cloud of points that I create by a FS.
my issue is that as there will be too many solids (around 2 to 3 k). until here everything works okey.
but when I try to fuse them all together the onshape server keeps loading (until it times out) and I can not achieve to generate my geometry.
an example of the cloud of points:
as the points are ordered first in the z-axis, then in y and lastly in x. so I thought about fusing all the elements in the pattern for each slice separately and then fuse each slice,
for this, I thought in to create a number of lists equal to the number of different z values, and then with a loop divide the big list of points in the list and then use it in the opPattern so something like this:
create cloud of points (from a loop) -> create N lists (N equal to the number of different values of z in the cloud) ->do N opPatterns -> fuse each N qCreatedby opPatterns -> duse all the N "slices"
I am pretty sure that there is a more clever/cleaner way to do this (I excuse myself as my solution is brut force.... ), but I do not see how to. anyone that could enlighten me with this issue?
best regards,
I want to create a pattern of solids in a cloud of points that I create by a FS.
my issue is that as there will be too many solids (around 2 to 3 k). until here everything works okey.
but when I try to fuse them all together the onshape server keeps loading (until it times out) and I can not achieve to generate my geometry.
an example of the cloud of points:
as the points are ordered first in the z-axis, then in y and lastly in x. so I thought about fusing all the elements in the pattern for each slice separately and then fuse each slice,
for this, I thought in to create a number of lists equal to the number of different z values, and then with a loop divide the big list of points in the list and then use it in the opPattern so something like this:
create cloud of points (from a loop) -> create N lists (N equal to the number of different values of z in the cloud) ->do N opPatterns -> fuse each N qCreatedby opPatterns -> duse all the N "slices"
I am pretty sure that there is a more clever/cleaner way to do this (I excuse myself as my solution is brut force.... ), but I do not see how to. anyone that could enlighten me with this issue?
best regards,
0
Comments
1. I use the axis of the cylinder as the vector for the linear pattern this will create a pattern that is not perfectly periodic as the following image (to keep the alignment of the structure I should go in discontinuous sections as in 2.) (see between 4th and 5th line of the boxes in the image at the end)
2. approximate the vector of the axis of the cylinder to a vector that would match to the grid (so a little bit more in x and y or a little bit less) the benefit of this approach is that the structure will match, but it risk of drift away from the solid I want to fill. (see the 3th 4th and 7th line of boxes)
I put the two problems in the same image for simplification
that way I thought about creating a line, fuse it, then the second one, fuse it, etc... that way I would limit the number of objects at the same time. (and in this case, I took a cylinder but I was also trying to do it with other types of manifold solids there are other software that handles quite well this type of things but are limited in others tools and I would prefer to stay with Onshape also ^^ )
But if you can do this better with other tools, perhaps it would be a worthwhile compromise to simply export geometry back and forth between that other software into OS.
I have mostly successfully created the custom feature but I am getting an error when I try to fuse the "slices" together,
I create each "slice" separatly with a loop:
{
opPattern(context, id + ("pattern"~n), {
"entities" : qCreatedBy(id + "cylinder1", EntityType.BODY),
"transforms" : sepTransforms[n],
"instanceNames" : sepInstanceNames[n]
});
opBoolean(context, id + ("boolean_"~n), {
"tools" : qCreatedBy(id + ("pattern"~n), EntityType.BODY),
"operationType" : BooleanOperationType.UNION
});
debug(context, "boolean_"~n);
}
until here everything is okey, then I after the creation of all the "slices" I redo a loop (I know that they could be done at the same time as the previous loop but as I was trying to debug I put it separately)
I do:
for (var n = 1 ; n <= size(zOfLayers); n+= 1)
{
debug(context, n);
dummy=n-1;
if (n==1)
{
debug(context, "boolean."~n);
debug(context, "boolean_"~n);
debug(context, "boolean_"~dummy);
slice= qUnion([qCreatedBy(id + ("boolean_"~dummy), EntityType.BODY), qCreatedBy(id + ("boolean_"~n), EntityType.BODY)]);
opBoolean(context, "boolean."~n, {
"tools" : slice,
"operationType" : BooleanOperationType.UNION
});
}
else
{
debug(context, "boolean."~n);
debug(context, "boolean_"~n);
debug(context, "boolean."~dummy);
slice= qUnion([qCreatedBy(id + ("boolean_"~n), EntityType.BODY), qCreatedBy(id + ("boolean."~dummy), EntityType.BODY)]);
opBoolean(context, "boolean."~n, {
"tools" : slice,
"operationType" : BooleanOperationType.UNION
});
}
}
from the results of the debug, I am getting the correct ids to call so I do not get why I still get the error, but I still get an error
EDIT:okey, from trying to find what was the problem, from the forum, I found that my query was empty: https://forum.onshape.com/discussion/8005/opboolean-dont-work
so I changed