Challenge

Week - 5 - Checking and correcting the Normals

Objective:

This task objective is to provide user with script that enables to make repetitive operations on normals, with instant view of the results. Tool has to display model in normal mode view, and update view as user makes changes. Operations on normals need to have their buttons embedded in window. For my needs I separated all the operations to be accessible both for surfaces and elements.

Problem Statement:

Built in function to display and change normals in Hypermesh is far form ideal as user has to perform multiple clicks in loop (identifying areas to change->make operations on normals->check the result). This can be facilitated by simple widget that keeps displaying normals all the time, and users only task is to mark surfaces/elements to work on. Correcting normals can be done either by auto adjustment or manual reversing.

For my professional use I need to access both surfaces and elements normals. For operation on surfaces Auto adjustment means that all elements associated with this surface will be flipped accordingly. For operations on elements Auto adjustment will adjust elements same as dominant normal direction among selected.

Tcl command explanation:

First two commands define normals view as colours. Then there are three procedures for buttons:

AdjustNormal when invoked for surfaces adjusts surfaces and elements simultaneously, when for elements auto adjustment is performed.

ReverseNormal reverses marked surfaces or elements.

CreateMark runs panel to mark surfaces or elements.

Last procedure UpdateView keeps display updated depending on input which can be: surfaces, element, or normals turned off.

Window is set to be topmost all the time and not resizable.

Two first radiobuttons switch between surface normals view and elements normal view, their variable is passed to all procedures (exepction is when normals are to be turned off)

Create mark button enables to mark entities and automatically switches selection options to be corresponding with the displayed mode.

Buttons Reverse and Auto adjust if clicked with no selection don't return error, last command for each procedure updates view.

Eventually user can turn normals of by selecting radio button (default is set to be on)

When closing window display is turned back to be default via wm protocol function.

Conclusion:

Created script enables to correct normals very fast, number of actions involved in this process has been significantly reduced. Script has already been proven to be useful in my team.



Created by Adam

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.