Friday, April 9, 2010

Circle Range Constraint, Rectangle Width and Rectangle Height Constraints

NaroCAD improves a bit more from constraint point of view. NaroCAD in the initial design have a function based constraint (meaning that other shape observe the current shape), but also have an interpreter based constraint (that was the main change in the constraints fixes done in the previous weeks).
The biggest problem with function based constraints was that they are a bit harder to work and their interface that they were exposed was not that helpful. One of the reasons was that these shape constraints were based on internal node structure which may mean nothing to an user. Making "high level" constraints that based on the internal representation, will create the corresponding constraint will make things easier. So as for now the range of a circle can be constrained, also the width and the height of the rectangles.
Those constraints are also available from command line invocation namely: circle_constraint, rectangle_width_constraint and rectangle_height_constraint, and after this you will have to pick the shape you want to work on and the constrained value you want to use for it.
Some work is still needed to be shown in a visual way at the OpenCascade level (to show a dimension like representation), but the rest of code will work (meaning that fixed values cannot be changed in property grid, as after you change, your value will go back to previous constrained value).
This work is submitted in my branch (lordcip) for now but will be available after some testing in the devel branch and in short time in the next version. Also I've made the nightly build to reflect the same branch. and I will sync this branch with others (mostly with devel branch) so you will may get the most "blog-enable" builds. Please take in account that those builds are highly unstable but are a good preview for fulfill your curiosity and give feedback of how those features work.

3 comments:

Bennai said...

hello,
i am a student in computer sciences and i try to work with open cascade.
now i try to use v3d_camera classe but i didn't found how to recuperate what the camera is seeing and show it to the user.
so i need help please.

Ciprian Khlud said...

Hi Bennai,

I used the View's "Eye", "At" and "Up" coordinates in the rendering code that catch enough right what camera is seeing.

This is a snapshot from NaroCAD's code on rendering.

private void UpdateViewParams()
{
double x = 0, y = 0, z = 0;
_view.Eye(ref x, ref y, ref z);
_eye = new Point3D(x, y, z);
_view.At(ref x, ref y, ref z);
_at = new Point3D(x, y, z);
_view.Up(ref x, ref y, ref z);
_up = new Point3D(x, y, z);
}

(this code is under: \Source\PartModeling\PartModeling\UI\Views\Rendering\RenderDialog.cs)

I honestly never used V3d_camera so I cannot give to you any help more that you found already.

Bennai said...

thank you