question

William Proctor avatar image
2 Likes"
William Proctor asked Phil BoBo edited

defining bounding box anchor location

I understand that there is a specific location within a 3D object's bounding box that become the anchor location (for determining the object's location). I believe that is it the lower left corner by default. Is there a way to change the anchor location (like put it in the upper middle location of the box)?

FlexSim 16.0.1
3d shape factors
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Phil BoBo avatar image
2 Likes"
Phil BoBo answered Phil BoBo edited

An object's location is stored in the tree by the corner of their unrotated bounding box shown here:

When you select the "Direct Spatials" mode for displaying the object's location, Quick Properties shows you the values that are stored in the tree for the location of the object. If you rotate an object, you'll notice that the object's location doesn't change (only its rotation changes):

The location edit mode in Quick Properties enables you to specify a location based on a certain reference point. For example, if you specify the upper planar midpoint as the reference point, then the location will be shown as (3.69, -1.5, 2) for the object above, instead of the (0, 0, 0) that is its actual location that is stored in the tree. You can then edit the location based on that reference point instead of the direct spatial location.

The object's location in the tree will still be stored as the "Direct Spatials" values, but this option enables you to enter the location based on a certain reference point.

You can also set the location dynamically based on these reference points using the Set Location pick option:

Here, you can specify a reference point similar to the Quick Properties window:

The command setloc() also takes 3 optional parameters. If you do not use these parameters, it sets the location directly, based on the "Direct Spatials" mode. If you use these three optional parameters, it sets the location based on a reference point within the yellow bounding box (as specified by 3 factor values between 0 and 1).

You can also use the command setcenter() to set an object's location based on its center point. This would be the same as setloc with 0.5 for each optional parameter:

setcenter(object, xloc, yloc, zloc);
setloc(object, xloc, yloc, zloc, 0.5, 0.5, 0.5);

direct-spatials.png (281.1 KiB)
direct-spatials2.png (280.8 KiB)
planar-mid-point.png (396.8 KiB)
set-location.png (93.5 KiB)
set-location2.png (219.2 KiB)
· 7
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Phil BoBo avatar image Phil BoBo ♦♦ commented ·

Attached is a model that uses a BasicTE to customize the offset location so that it drives the front of the yellow box to the location specified in the Travel To Loc task.

You could use this BasicTE as your Combine instead of the TaskExecuter object so that it rotates as normal, but travels to the edge of the yellow box.

1 Like 1 ·
combine-basic-te.fsm (470.2 KiB)
William Proctor avatar image William Proctor Phil BoBo ♦♦ commented ·

Thanks Phil. I'll take a look.

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ William Proctor commented ·

This forum works a little different than our other user forum in that each "Answer" is meant to be an actual answer to the question, not a reply to a previous post. Post-reply conversations are meant to be done in the comments of each answer. This makes answer finding easier for people who are skimming. So I've converted your answers into comments.

1 Like 1 ·
William Proctor avatar image William Proctor commented ·

Thanks for the clarification on this works. I can see how to change the value. It impacts the location displayed on the screen, but it doesn't seem to have an affect on the dispatch command that I am using "inserttask(ts,TASKTYPE_TRAVELTOLOC,NULL,NULL,x,y,z,0).

I'm trying to end up with the front center of the Task Executor aligned with the X,Y,Z coordinate when I get to the location but it is still using another location within the object for this task (center?) (I've moved the reference point to several locations to see the affect)

What point within the object boundary is used when doing a TRAVELTOLOC command?

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ William Proctor commented ·

The point used in a Travel To Loc task depends on the TaskExecuter. An operator travels differently than an ASRS or a Crane, etc. Can you post a small example that shows what you are actually trying to do?

1 Like 1 ·
William Proctor avatar image William Proctor commented ·

I can use an operator instead of a TaskExecutor if that makes things easier. Essentially I'm creating a piece of equipment that can be flexibly routed anywhere on the field without a path network..

0 Likes 0 ·
William Proctor avatar image William Proctor commented ·

OK. That does seem to work. Will my vehicle rotation location center then be at the same location? If so, is there a way to move it between the rear wheels? Thanks.

0 Likes 0 ·