Managing data: how to separate different type of data?

hi everybody!
i want to separate different type of data.

for example, i have to rotate some surfaces and curves at the same time, but then pick only the curves.

here i created a simple definition just to experiment

studio-separate different types of objects.gh (14.7 KB)

For example i would divide the data in groups with the different type of objects. In this particular case i know which ones are (planar curve, surface, line) but a general reasoning would be helpful.

Anybody with any suggestions how this could be done?

Regards
Ascanio

Here is a Quick and Dirty way to split data using text filtering

studio-separate different types of objects_By Branch.gh (18.1 KB)

1 Like

very interesting thank you @tay.alrawi
I added something. take a look here.
I created a parametric number slider to adapt the max number of types of different objects

studio-separate different types of objects_By Branch_re.gh (21.2 KB)

2 Likes

Wow @huskenazy I just learned a new Meta-Trick with Metahopper.

Thank you

1 Like

you’re alright @tay.alrawi ! that’s wonderful. You don’t know how much time i looked for something similar.

Anyway also your text filtering it’s nice, i think i never used it or almost… the logic it’s not so immediate for me but it works :sweat_smile: :face_with_monocle:

1 Like

There are components for filtering like" is planar" for curves or surfaces as well.

1 Like

im tryng an application of your definition for on other similar case. let’s see if it’s works. i’ll post here

1 Like

the tricky thing it’s that often to do a quite simple thing, like this filtering action, you need a lot of space and defimtion become very big and difficult to manage. Maybe i’ll transform it in a cluster

i cleaned up a bit @tay.othman

studio-separate different types of objects_By Branch_re.gh (30.8 KB)

#metahopper @metahopper
i didnt understand why the number slider doesnt work if i create a cluster. anyone how does it works? maybe i’ll create a new topic for this
@andheum

@tay.othman application of the definition in a different case. it doesnt work. :smiling_face_with_tear:

studio-separate different types of objects.1_points,lines,curves.gh (14.7 KB)

1 Like

@huskenazy

With a Little Help from Elefront and Pufferfish, you can build a really solid cluster


studio-separate different types of objects.1_points,lines,curves_Surfaces.gh (16.8 KB)

2 Likes

Wow thank you @tay.0 ! very interesting, i’ll take a look when i have time.
Anyway i have to install those plug-in before, and on other i dont know, it says it’s called “HFTidyCanvas”. Where can i find HFTidyCanvas?

I am installing the plug-in Elefront. Do you know any basic tutorials where to start learnin’ it?

Hello @huskenazy

It is part of Autograph (which is a sibling for Elefront) if you install elefrtont it should bring some tools associated with.

I learned elefront few years back (probably 2018) when I took this class, it is about referencing, baking and then referencing workflow:

1 Like

Hello @tay.othman.
I had seen that course some time ago, but didn’t have time to attend it.
When I learn a little bit, maybe we can talk about some Elefront things in the future.
regards

1 Like

can’t wait , will do it for sure.

Here is a python example:
studio-separate different types of objects_v2.gh (24.3 KB)

import rhinoscriptsyntax as rs

line = []
curve = []
srf = []
pnt = []

for i in x:
    if rs.IsCurve(i) and rs.IsLine(i): line.append(i)
    elif rs.IsSurface(i): srf.append(i)
    elif rs.IsPoint(i): pnt.append(i)
    else: curve.append(i)

2 Likes

Thank you @Adam_M.
is it difficult to do something like that? I have never used coding

i would like to do some operation like
If, do A
If not, do B

For instance:
I have a point. And want to move it in different directions.
If its coordinate z>0, move in direction v
if z<0, move in direction -v
If z=0 dont move.

How would you do? Is it simpler doing it in grass or with coding in python?

You could do something like this:

import rhinoscriptsyntax as rs

line = []
curve = []
srf = []
pnt = []

for i in x:
    if rs.IsCurve(i) and rs.IsLine(i): line.append(i)
    elif rs.IsSurface(i): srf.append(i)
    elif rs.IsPoint(i): pnt.append(i)
    else: curve.append(i)

for i in pnt:
    if rs.coerce3dpoint(i).Z == 0:
        rs.MoveObject(i,[0,0,20])

Sorry @Adam_M I cant understand it. I mean, I dont use python.
My question is how much its difficult to do something like that.
if its not so difficult for task like these i could learn a bit of code, if not i prefer using traditional grasshopper components

Im not at pc now, ill post the specific issue when im at the pc
Greetings

There are so many different ways to do this stuff.

For me I like to use Python if it helps me to: avoid using plugins, where it can simplify workflow, for doing recursive loop, etc.

I have started to work more and more with Python over the last years. Personally I found it easier to pick up than C#…but everyone is different in that respect.

Using native GH, you could deconstruct the points, and filter/move the points based on the z value.

1 Like