Avoid numbers in Operator Parameter

   3734   11   2
User Avatar
Member
67 posts
Joined: April 2017
Offline
I need to know if posible to avoid certain numbers when defining the Range in a float expresion parameter.
The float Range goes from 0 to 1.

I need to avoid the following numbers:
0
0,25
0,5
0,75
1

In some expresions, using the symbols ^ or ! negates de selection.
¿Is there a way to use in Range selecction??
Thanks.
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
something like this, really stupid solution, i know.
Have a look at the translate expression…

Why would you avoid those numbers?
Edited by matthias_k - Oct. 23, 2017 19:14:04

Attachments:
avoid.hip (52.4 KB)

English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
67 posts
Joined: April 2017
Offline
if (ch("testx")==0||ch("testx")==0.25||ch("testx")==0.5||ch("testx")==0.75||ch("testx")==1,ch("testx")+0.001,ch("testx"))
Thanks again Mathias,
after using Refine in a quad_grid + Copy to point , the corners breaks the simulation. I solved it using with the Resample node and deleting the corners (with Sort to point (0,0,0) + Delete 0,1,2,3 points).

The image below is for place a Door in a wall.
¿Is there any trick or best way to do??
Im very newbie.

Attachments:
refine_resample.jpg (125.0 KB)

User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
Hi bhbilbao,

is it possible to share the scene?
English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
648 posts
Joined: July 2005
Offline
in this case you can check corner angles and skip them.

Attachments:
avoidcorners.hiplc (143.7 KB)

User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
Something like this?
You can maybe break it for each wall
and add some controls for “which wall”
then resample to half door width, delete each first/last point
and then use the carve to move the door…

Attachments:
simple_hole_in_the_wall.jpg (220.2 KB)
simple_hole_in_the_wall.hip (77.8 KB)

English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
67 posts
Joined: April 2017
Offline
is it possible to share the scene?
The photo I uploaded? Yes of course you can.

Both examples you uploaded are fantastic.
For the first one is dificult to understand the relation between “Resample>segments” and “Marker>modulo” , changing those numbers alters the number and positions of the doors.. but dificult to control them.

The second one has the issue with the Bool, it breaks also the corners making dificult to place a door after in such place.

Attachments:
door_corner.jpg (46.9 KB)

User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
@The second one has the issue with the Bool, it breaks also the corners making dificult to place a door after in such place.

Yes, I know, that's what I said:
Use a Carve SOP with “Breakpoints” on the “Wall Curve”
Then put it in an HDA with a select slider for the “Wall”.
On the Segments add A: a resample with proper values, then delete
first/last point.

Simple example attached, yes I know, it needs some more love ;-)

Attachments:
simple_hole_in_the_wall-1.hip (96.1 KB)

English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
As subnet… have fun.

Attachments:
simple_hole_in_the_wall-1.hip (98.7 KB)

English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
Some last add…
to show an alternative way to delete only “corners”.

Attachments:
delete_corners.hip (73.1 KB)
delete_corners.jpg (229.4 KB)

English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
555 posts
Joined: Feb. 2017
Offline
easiest way is to add Measure>Curvature.
Then Delete, Points, Delete by Expression: @curvature>5 (or whatever you see fit)
Points in a straight line would naturally have curvature = 0 so won't be deleted
Edited by vusta - Oct. 24, 2017 23:48:58

Attachments:
CornerCurvature1.jpg (178.0 KB)
vu_CornerCurv.hipnc (59.0 KB)

User Avatar
Member
67 posts
Joined: April 2017
Offline
Thanks Matthias_k & Vusta.
The examples you both posted here solved my problem.
The example “simple_hole_in_the_wall-1.hip” posted by Mathias with the ability to place the door in one particular wall + position it, … priceless for me!. Thanks very much Matthias , I appreciate your help.
  • Quick Links