Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Chain Offset Contour


Recommended Posts

I'm still having a rough time creating a consistent offset direction for my chains.

I have tried:
ChainDirectionType
StartChainAtLongest
OrientOpenChainsInDatabaseOrder
chainData.FirstEntityIsFlipped == true
RelinkChains

and various combinations of the listed above.

Using var selectedCutChain = ChainManager.ChainAll(80); and chain.Direction = ChainDirectionType.Clockwise; has gotten me the best result.

Corners A and A match while corners B and B match. (They are all identical geometry). However, corner A does not match corner B.

Out of the 12 chains available, 10 are correct. Even 2 chains that are the exact same.

Any other thoughts to try? 🤷‍♂️

corners.png

Link to comment
Share on other sites
1 hour ago, JKLINE said:

I do not know what is meant by this. ->

1 hour ago, JKLINE said:

Corners A and A match while corners B and B match. (They are all identical geometry). However, corner A does not match corner B.

You have geometry on a level.
You chain all “this level”.
I think this would work to get all the chains going the same direction: CW or CCW
Loop through the chains and set the Direction of each chain to the desired ChainDirectionType
Now are not all the chains going the same direction?
Now that you know the chain’s direction you can know which “side” to use in the OffsetChains2D call.

Link to comment
Share on other sites

That was my exact thinking process. And it works everywhere except on 2 particular chains.

                var selectedCutChain = ChainManager.ChainAll(80);
                foreach (var chain in selectedCutChain){
                    chain.Direction = ChainDirectionType.Clockwise;
                    var lowerChainLarge = chain.OffsetChain2D(OffsetSideType.Right, .0225, OffsetRollCornerType.None, .5, false, .005, false);
Link to comment
Share on other sites

So....

It appears al the chains should now be going Clockwise.  Can we verify that?

The only other thin here is the OffsetChain2D that we assume worked proper for each chain, so that's probably not the issue.

With a clockwise Chain and OffsetSidedType.Right it looks like you are wanting to new offset chain to be "inside" the original chain.

If  you cannot get the OffsetChain2D result to be "correct", lease send us the geometry file and the offsetting code you are using.

Link to comment
Share on other sites

Roger,

I left it in the last package I've sent to SDK. 1 problem being the moving geometry (level 80 moves to level 502) and the other being this issue.

I have also chained (manually selected) less chains and the problem moves. Making it VERY difficult for me to narrow down.

Starting with level 80, it creates level 500 which should match level 200 and it creates level 501 which should match level 300.

I've started thinking that Mastercam is thinking about ALL the geometry at once, as you said "inside the original chain". But if a chain is 'inside' another chain then it could offset to the un-intended side.

Link to comment
Share on other sites
Quote

But if a chain is 'inside' another chain then it could offset to the un-intended side.

A "chain nested inside of another chain" should not make any difference.

I would suggest "breaking down your process" and then building it back step-by-step.
To start forget about doing the level manipulations, etc.
? -> Starting with level 80, it creates level 500 which should match level 200 and it creates level 501 which should match level 300

First, nail down just the first step you want to do with the chains. (e.g. Offsetting the Chains)
Once you have that figured out, then you can add back in the other processes your add-in is supposed to do.

Edited by Roger Martin from CNC Software
Link to comment
Share on other sites

Broken down and still found fault. 

            void offsetCutchain80(){
                var selectedCutChain = ChainManager.ChainAll(80);
                foreach (var chain in selectedCutChain){
                    chain.Direction = ChainDirectionType.Clockwise;
                    var lowerChainLarge = chain.OffsetChain2D(OffsetSideType.Right, .0225, OffsetRollCornerType.None, .5, false, .005, false);
                    GraphicsManager.ClearColors(new GroupSelectionMask(true));
                }
            } 
            offsetCutchain80();

 

Link to comment
Share on other sites
12 minutes ago, JKLINE said:

Broken down and still found fault. 

            void offsetCutchain80(){
                var selectedCutChain = ChainManager.ChainAll(80);
                foreach (var chain in selectedCutChain){
                    chain.Direction = ChainDirectionType.Clockwise;
                    var lowerChainLarge = chain.OffsetChain2D(OffsetSideType.Right, .0225, OffsetRollCornerType.None, .5, false, .005, false);
                    GraphicsManager.ClearColors(new GroupSelectionMask(true));
                }
            } 
            offsetCutchain80();

 

Your tolernace is too big

Link to comment
Share on other sites
1 minute ago, JKLINE said:

I am setting all the chain.Direction = ChainDirectionType.Clockwise;

It's working 14 times out of the 16 chains. 😅

Once you create the chain, check the direction, is it set the way you want?

If not, reverse it

Are these closed chains?

See this topic about open/closed chains

 

Link to comment
Share on other sites

I like this idea.

Running this offsets all but 4 chains.

                    if (chain.Direction == ChainDirectionType.Clockwise)
                    {
                        var lowerChainLarge = chain.OffsetChain2D(OffsetSideType.Right, .0225, OffsetRollCornerType.None, .5, false, .0001, false);
                    }

Running this offsets the other 4 chains, but 2 go one direction and the other 2 go another 😅

                    if (chain.Direction == ChainDirectionType.CounterClockwise)
                    {
                        var lowerChainLarge = chain.OffsetChain2D(OffsetSideType.Left, .0225, OffsetRollCornerType.None, .5, false, .0001, false);
                    }

 

Link to comment
Share on other sites

You might need to set the ChainTolerance in the ChainManager class to get a complete chain if there are gaps

That sets the global, so u should revert it after

You can't get the chain direction of an open chain, even though there is a direction, it's arbitrary, because mastercam needs a pocket boundary or closed chain for offsetting a certain direction, I gather you are trying to make a closed chain but it's not working?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...