Page 1 of 1

VB6 example for "Planar Clip operation"

Posted: Wed Oct 16, 2024 3:07 pm
by TheLeePiper
We are trying to implement an intersection using a horizontal plane on a model volume, as described in the ActiveX docs for "Boolean Operations on Entities". While we can get it to work with an edge of a box object, we cannot figure out how to do this as described using the "Planar Clip operation" example. Could you post a few lines of sample VB6 code to explain how this would be done? Thanks!

Re: VB6 example for "Planar Clip operation"

Posted: Fri Oct 18, 2024 1:16 am
by Prashant Kande
Hello.
Sorry, we have found a bug in this functionality. We are coding a fix. There will be an update in few days. We will post a notification on this thread.
Thanks for reporting.

Re: VB6 example for "Planar Clip operation"

Posted: Thu Oct 24, 2024 2:51 am
by Prashant Kande
We have sorted this out in today's 5544 update.

The access to the operation had to change. The old way was a bad idea a while ago. It worked with old compilers, but not any longer. We have dropped support for clipping planes in v6 I think. The planar ops sample wend down with it. So, unfortunately, the test case was lost.

Here is the new way: Planar Ops (ActiveX), Planar Ops (DGKC).

At the moment we do not have VB code for it. And my VB6 is too rusty. We do not really support it, despite it still works. Here is C# version:

Code: Select all

IDictionary_DG context = m_gen.Create<IDictionary_DG>();
PlaneDg plane = CreatePlane();

context.SetDouble("PlaneOriginX", plane.Origin[0]);
context.SetDouble("PlaneOriginY", plane.Origin[1]);
context.SetDouble("PlaneOriginZ", plane.Origin[2]);

context.SetDouble("PlaneNormalX", plane.Normal[0]);
context.SetDouble("PlaneNormalY", plane.Normal[1]);
context.SetDouble("PlaneNormalZ", plane.Normal[2]);

context.SetString("Operation", "Clip");	// Or "Subtract"

IObject_DG iObj = m_entity.As<IObject_DG>();

iObj.Execute("PlanarOperation", context);
This is from PlanarOpsTst.Execute(string operation)

You can see it working if you run the top test in the installed Samples\NET\C#\Tests\InterfaceTests\

Re: VB6 example for "Planar Clip operation"

Posted: Thu Oct 24, 2024 3:01 am
by Prashant Kande
A C++ version: Download
It is a restored PlanarOps sample. It is kind of dirty right now. See the PlanarOpsDlg::OnCut()
I hope we have time to add it to an update.

Re: VB6 example for "Planar Clip operation"

Posted: Thu Oct 24, 2024 2:31 pm
by TheLeePiper
Thanks so much! I'll download and test.