Skip to content

feat (rhino): receive revit solids as breps#1273

Draft
dogukankaratas wants to merge 3 commits intodevfrom
dogukan/cnx-2918-revit-solids-to-rhino-breps
Draft

feat (rhino): receive revit solids as breps#1273
dogukankaratas wants to merge 3 commits intodevfrom
dogukan/cnx-2918-revit-solids-to-rhino-breps

Conversation

@dogukankaratas
Copy link
Contributor

@dogukankaratas dogukankaratas commented Feb 6, 2026

Rhino Side

On the Rhino side we added a receive setting that converts tagged geometries to Breps using Rhino API function Brep.CreateFromMesh``. After creating the mesh we also call MergeCoplanarFaces` to combine triangulated faces to make them easy to work.

The setting is disabled by default since it adds a performance overhead while merging all the faces in the same plane.

settings

@linear
Copy link

linear bot commented Feb 6, 2026

@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 33.05%. Comparing base (e22527f) to head (b47d13d).
⚠️ Report is 14 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1273      +/-   ##
==========================================
- Coverage   41.32%   33.05%   -8.28%     
==========================================
  Files         117      118       +1     
  Lines        3228     3180      -48     
  Branches      315      325      +10     
==========================================
- Hits         1334     1051     -283     
- Misses       1851     2090     +239     
+ Partials       43       39       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dogukankaratas dogukankaratas marked this pull request as ready for review February 6, 2026 12:09
public const string SETTING_ID = "convertMeshesToBreps";

public string? Id { get; set; } = SETTING_ID;
public string? Title { get; set; } = "Convert solid meshes to Breps";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convert meshes to polysurfaces


public class ConvertMeshesToBrepsSetting(bool value = false) : ICardSetting
{
public const string SETTING_ID = "convertMeshesToBreps";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convertMeshesToPolysurfaces

SOG.ExtrusionX extrusion => _extrusionConverter.Convert(extrusion),
SOG.Line line => new() { _lineConverter.Convert(line) },
SOG.Mesh mesh => new() { _meshConverter.Convert(mesh) },
SOG.Mesh mesh => new() { _meshConversionHelper.ConvertMesh(mesh) },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't believe we need another wrapper/helper class for this operation. Just use utility in the converter class.

var solidDisplayMeshes = _meshByMaterialConverter.Convert((solidMeshesByMaterial, element.Id, makeTransparent));
foreach (var solidMesh in solidDisplayMeshes)
{
solidMesh["fromSolid"] = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we would need this flag at all? Why not to just try to convert all upcoming meshes in rhino. theoratically we should not touch anything on revit side.

@dogukankaratas
Copy link
Contributor Author

Comments addressed and revit side is cleaned @oguzhankoral

@oguzhankoral
Copy link
Member

It stuck here for more than 20 minutes, and this is a mid-size model. I am tempted to say 'NO' to this solution, even if it's optional.

image

@oguzhankoral oguzhankoral marked this pull request as draft February 10, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants