Incorrect transformation from Occurrence transform.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
We are taking transformation matrix from the occurrences.
But when the joints in assembly are not correct, but In GUI it shows correct position of parts.
And when we try to get the transformation matrix from APIs, it gives incorrect transformation. Please refer attached screenshot.
We are using following code snippet.
adsk::core::Ptr<adsk::core::Product> activeProduct = app->activeProduct();
adsk::core::Ptr<adsk::fusion::Design> design = activeProduct;
adsk::core::Ptr<adsk::fusion::Component> rootComp = design->rootComponent();
adsk::core::Ptr<adsk::fusion::Occurrences> occurrences = rootComp->occurrences();
if (occurrences != nullptr)
{
int occurancesCount = (int)occurrences->count();
if (occurancesCount > 0)
{
for (int childOccurancesCnt = 0; childOccurancesCnt < occurancesCount; childOccurancesCnt++)
{
adsk::core::Ptr<adsk::fusion::Occurrence> occ = occurrences->item(childOccurancesCnt);
if (occ != nullptr)
std::vector<double> transMat = child->transform()->asArray();
}
}
}
Please guide us to get correct transformation.
Please let us know if we are missing anything.