91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 18KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-10
  • 語(yǔ)言: 其他
  • 標(biāo)簽: Revit??JSON??

資源簡(jiǎn)介

revit導(dǎo)出json數(shù)據(jù)源代碼,請(qǐng)需要這下載使用

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.Diagnostics;
using?System.Linq;
using?Autodesk.Revit.DB;

namespace?CustomExporterAdnMeshJson
{
??///?
??///?The?data?format?specifying?one?solid?for?the?
??///?WebGL?viewer?defining?its?centre?colour?id
??///?triangular?facets?their?vertex?coordinates?
??///?indices?and?normals.
??///?

??class?AdnMeshData
??{
????int?FacetCount?{?get;?set;?}?//?optional
????int?VertexCount?{?get;?set;?}?//?optional
????int[]?VertexCoords?{?get;?set;?}
????int[]?VertexIndices?{?get;?set;?}?//?triangles
????double[]?Normals?{?get;?set;?}
????int[]?NormalIndices?{?get;?set;?}?//?not?optional?one?normal?per?vertex
????int[]?Center?{?get;?set;?}
????int?Color?{?get;?set;?}
????string?Id?{?get;?set;?}

????///?
????///?Apply?this?factor?to?all?point?data?when?
????///?saving?to?JSON?to?accomodate?the?expected
????///?scaling.
????///?

????const?double?_export_factor?=?0.002;

????public?AdnMeshData(
??????VertexLookupInt?vertices
??????List?vertexIndices
??????NormalLookupXyz?normals
??????List?normalIndices
??????PointInt?center
??????Color?color
??????double?transparency
??????string?id?)
????{
??????int?n?=?vertexIndices.Count;

??????Debug.Assert(?0?==?(n?%?3)?
????????“expected?triples?of?3D?point?vertex?indices“?);

??????Debug.Assert(?normalIndices.Count?==?n?
????????“expected?a?normal?for?each?vertex“?);

??????FacetCount?=?n?/?3;

??????n?=?vertices.Count;
??????VertexCount?=?n;
??????VertexCoords?=?new?int[n?*?3];
??????int?i?=?0;
??????foreach(?PointInt?p?in?vertices.Keys?)
??????{
????????VertexCoords[i++]?=?p.X;
????????VertexCoords[i++]?=?p.Y;
????????VertexCoords[i++]?=?p.Z;
??????}
??????VertexIndices?=?vertexIndices.ToArray();

??????n?=?normals.Count;
??????Normals?=?new?double[n?*?3];
??????i?=?0;
??????foreach(?XYZ?v?in?normals.Keys?)
??????{
????????Normals[i++]?=?v.X;
????????Normals[i++]?=?v.Y;
????????Normals[i++]?=?v.Z;
??????}
??????NormalIndices?=?normalIndices.ToArray();

??????Center?=?new?int[3];
??????i?=?0;
??????Center[i++]?=?center.X;
??????Center[i++]?=?center.Y;
??????Center[i]?=?center.Z;

??????byte?alpha?=?(byte)?(?
????????(?100?-?transparency?)?*?2.55555555?);

??????Color?=?ConvertClr(?
????????color.Red?color.Green?color.Blue?alpha?);

??????Id?=?id;
????}

????///?
????///?Convert?colour?and?transparency?to?
????///?the?required?integer?format.
????///?

????static?int?ConvertClr(?byte?r?byte?g?byte?b?byte?a?)
????{
??????return?(?r?<????}

????public?string?ToJson()
????{
??????//?I?did?think?of?using?a?JSON?serialiser?
??????//?either?one?of?these?two?provided?by?the
??????//?.NET?framework?or?one?of?the?other?libraries:
??????//?System.Runtime.Serialization.Json.DataContractJsonSerializer?
??????//?System.Web.script.Serialization.J

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2016-06-26?19:34??CustomExporterAdnMeshJson-2017.0.0.0\
?????文件????????4195??2016-06-26?19:34??CustomExporterAdnMeshJson-2017.0.0.0\.gitignore
?????文件?????????965??2016-06-26?19:34??CustomExporterAdnMeshJson-2017.0.0.0\CustomExporterAdnMeshJson.sln
?????目錄???????????0??2016-06-26?19:34??CustomExporterAdnMeshJson-2017.0.0.0\CustomExporterAdnMeshJson\
?????文件????????4271??2016-06-26?19:34??CustomExporterAdnMeshJson-2017.0.0.0\CustomExporterAdnMeshJson\AdnMeshData.cs
?????文件????????1333??2016-06-26?19:34??CustomExporterAdnMeshJson-2017.0.0.0\CustomExporterAdnMeshJson\CentroidVolume.cs
?????文件????????2548??2016-06-26?19:34??CustomExporterAdnMeshJson-2017.0.0.0\CustomExporterAdnMeshJson\Command.cs
?????文件?????????540??2016-06-26?19:34??CustomExporterAdnMeshJson-2017.0.0.0\CustomExporterAdnMeshJson\CustomExporterAdnMeshJson.addin
?????文件????????3551??2016-06-26?19:34??CustomExporterAdnMeshJson-2017.0.0.0\CustomExporterAdnMeshJson\CustomExporterAdnMeshJson.csproj
?????文件????????7893??2016-06-26?19:34??CustomExporterAdnMeshJson-2017.0.0.0\CustomExporterAdnMeshJson\ExportContextAdnMesh.cs
?????文件????????1190??2016-06-26?19:34??CustomExporterAdnMeshJson-2017.0.0.0\CustomExporterAdnMeshJson\NormalLookupXyz.cs
?????文件????????1140??2016-06-26?19:34??CustomExporterAdnMeshJson-2017.0.0.0\CustomExporterAdnMeshJson\PointInt.cs
?????目錄???????????0??2016-06-26?19:34??CustomExporterAdnMeshJson-2017.0.0.0\CustomExporterAdnMeshJson\Properties\
?????文件????????1600??2016-06-26?19:34??CustomExporterAdnMeshJson-2017.0.0.0\CustomExporterAdnMeshJson\Properties\AssemblyInfo.cs
?????文件????????1473??2016-06-26?19:34??CustomExporterAdnMeshJson-2017.0.0.0\CustomExporterAdnMeshJson\Util.cs
?????文件????????1224??2016-06-26?19:34??CustomExporterAdnMeshJson-2017.0.0.0\CustomExporterAdnMeshJson\VertexLookupInt.cs
?????文件????????5822??2016-06-26?19:34??CustomExporterAdnMeshJson-2017.0.0.0\CustomExporterAdnMeshJson\x.cs
?????文件????????1080??2016-06-26?19:34??CustomExporterAdnMeshJson-2017.0.0.0\LICENSE
?????文件?????????873??2016-06-26?19:34??CustomExporterAdnMeshJson-2017.0.0.0\README.md

評(píng)論

共有 條評(píng)論