Jump to content

New union capsule based on two different capsules


Go to solution Solved by Thorsten Vogt,

Recommended Posts

Posted

I would like generate new capsules, grouped as -> start of capsules from first capsules until end of second capsules

When doing just a union $c = $a.union($b) the capsules in $c are not getting grouped as needed.

thanks for any help

5.PNG

6.PNG

4.PNG

Posted

Thanks for the hint Joe, I checked the composite Condition but I still don´t figured out yet how to:

after rethinking I need to re-specify what I´m trying to achieve. On the same capsule layer, on the first found Capsule-1 extend the end of this Capsule-1

until the start of Capsule-2. Then again extend Capsule-3-end until start of Capsule 4 and so on.

To only make this on the capsule-pairs 1/2 3/4 5/6 ... maybe somehow count up?

 

7.PNG

  • Solution
Posted

Hello,

you might want to check the following way:

As you need to specify which is the first capsule you want to start with you need to define a bounding condition. In my example I use a monthly condition to do the calculation:

image.png.b88139b6db53fbe65efebb0219697bc7.png

Next I created a signal that puts the value 1 at the start of each capsule:

$condition.removeLongerThan(40h).toSamples($c -> sample($c.startKey(), 1), 0s)

image.png.8b32f693ac5b1f91d45de4bfdedd916e.png

This signal is used to build the running sum of these values:

image.png.1f67af7b1832a3733af001fa779e09ef.png

The calculated value can be used to extend the original condition with a property containing the capsule number during each month:
 

$condition.removeLongerThan(1d).setProperty('Capsule Number', $count, startValue())

image.png.989acb1ce5d2f749c7bf9ca8740ecd26.png

Then two new conditions can be created to include only capsules with odd and even capsule numbers:
 

$conditionWithCount.keep($c -> ($c.property('Capsule Number')/2)-floor($c.property('Capsule Number')/2) > 0)
$conditionWithCount.keep($c -> ($c.property('Capsule Number')/2)-floor($c.property('Capsule Number')/2) == 0)

image.png.36f771890661b77763abc1f955cc9971.png

A composite condition can be used to join the odd and even ones:

image.png.5b7a3b1bc50b7ab7f968ea5db8eb65a5.png

Hope this helps.

Regards,

Thorsten

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...