Show Zebra Stripes During Dynamic Draw? (C++)

Hi Robert,

I’ve added a new CRhinoDisplayPipeline::DrawZebraPreview that can be called from a display conduit. This new method will appear with Rhino 6 Service Release 16 (still a few weeks away). When this filters though to a public SDK, I’ll add a sample command to the developer samples repo.

https://mcneel.myjetbrains.com/youtrack/issue/RH-53350

– Dale

1 Like

@XNurbs will you add this when it becomes available?

Thanks Dale!

That’s exactly what I am looking for! I’ll be on the lookout for the update when it comes around.

– Robert

Hi @robert.beck12569,

This sample will work with the SR16 SDK when it is available.

cmdSampleZebraPreview.cpp (3.4 KB)

– Dale

Sure. In fact, we asked Rhino to provide the function.

1 Like

RH-53350 is fixed in the latest Service Release Candidate

Hi @dale

When I test in python it shows error.

import Rhino
import System
import rhinoscriptsyntax as rs

ids = rs.GetObjects("Select objects for zebra display", 8+16+32)
breps = [rs.coercebrep(id) for id in ids]
Rhino.Display.DisplayPipeline.DrawZebraPreview(breps, System.Drawing.Color.FromArgb(255,255,255))

Hi @Alen_Russ,

DisplayPipeline.DrawZebraPreview is for dynamically drawing Breps with zebra stripe from within a display conduit, which you don’t have.

My guess is you want to do this:

SampleCsZebraAnalysis.cs

Does this help?

– Dale

Thank you for your help. I want to preview the zebra print display and analysis of objects in Python, but I will not interrupt my command of creating surfaces.

Hi @Alen_Russ,

You can create display conduits in Python. Here is an example:

SampleDrawMeshConduit.py

– Dale

1 Like

Thanks
I will check this

Hi, I tried DrawZebraPreview and it works fine.

However it would be great, if a similar function could also be offered for a mesh! This would be more general, since I could create mesh(es) also from a Brep or even a single surface/face.

I just downloaded the Rhino 7 SDK and was looking for something like this.

I’m currently working on a smooth mesh command, which could show update of the Zebra stripes during the smoothing.

  • Peter

Hi @Peter_Salzman,

I’ve added your request to the pile:

https://mcneel.myjetbrains.com/youtrack/issue/RH-60927

Thanks,

– Dale

Many thanks!

Best
Peter

Hello.boy,i also have this problem, can you post your way?or post a example to display zebra

I just noticed, that Dale’s addition appeared in the Rhino 7.4 SDK (see below). It works fine! I will also add a small video how it works in my function.

CRhinoDisplayPipeline::DrawZebraPreview(
const ON_Mesh* mesh,
const CRhinoZebraAnalysisSettings& zas,
const ON_Color& color,
CRhinoCacheHandle* cache
);

1 Like

Mhm, I can’t upload my video format so I will just upload 2 screenshots. It is a function that can smooth selected areas from a mesh - they show the mesh before and after smooth with zebra stripes.


1 Like

Here is a simple Python sample.

test_zebra_conduit.py (1.5 KB)

– Dale

I have a similar effect - using a striped texture on a mesh during a dynamic draw, as a visual feedback for the main tween-edit functionality.

So far, it’s used in the TweenerAddControl function in Tweener | Food4Rhino and done with pure C#, works fast enough since only the mesh vertex texture list needs to be updated in each draw.
However, it would be great to share some “zebra-controlling” code.

Hello @dale ,

is it possible to set zebra preview strip size and direction without zebra analysis mode in C#? I have found its using last settings from analysis. Could I override them?

Łukasz

EDIT:
I see c++ gives such opportunity but similar setting is missing in RhinoCommon :frowning: Is it possible to add this also there?
https://developer.rhino3d.com/api/cpp/class_c_rhino_zebra_analysis_settings.html