CN111429564A - Method, system and medium for generating a neurocellulose model based on Unity3D - Google Patents

Method, system and medium for generating a neurocellulose model based on Unity3D Download PDF

Info

Publication number
CN111429564A
CN111429564A CN202010167548.0A CN202010167548A CN111429564A CN 111429564 A CN111429564 A CN 111429564A CN 202010167548 A CN202010167548 A CN 202010167548A CN 111429564 A CN111429564 A CN 111429564A
Authority
CN
China
Prior art keywords
neurocellulose
vector
line segment
model
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010167548.0A
Other languages
Chinese (zh)
Other versions
CN111429564B (en
Inventor
周振华
吕天予
肖建如
马科威
矫健
邵帅
吴哲宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Jiaao Information Technology Development Co ltd
Original Assignee
Shanghai Jiaao Information Technology Development Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Jiaao Information Technology Development Co ltd filed Critical Shanghai Jiaao Information Technology Development Co ltd
Priority to CN202010167548.0A priority Critical patent/CN111429564B/en
Publication of CN111429564A publication Critical patent/CN111429564A/en
Application granted granted Critical
Publication of CN111429564B publication Critical patent/CN111429564B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • G06T15/55Radiosity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Geometry (AREA)
  • Architecture (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Processing Or Creating Images (AREA)
  • Image Generation (AREA)

Abstract

The invention provides a method, a system and a medium for generating a neurocellulose model based on Unity3D, wherein the method comprises the following steps: step 1: reading an OBJ file of the neurocellulose according to StreamReader class to obtain the neurocellulose, wherein each neurocellulose comprises a plurality of line segments; step 2: generating a circular bounding box by taking the line segment as a center to obtain a nerve cellulose model; and step 3: and reading the color information RGB in the shader loader to obtain the color-gradient neurocellulose model. The invention can ensure the display effect and color display; the method is simple, and the rendering pressure of software is relieved.

Description

Method, system and medium for generating a neurocellulose model based on Unity3D
Technical Field
The invention relates to the technical field of three-dimensional modeling, in particular to a method, a system and a medium for generating a neurocellulose model based on Unity 3D.
Background
At present, a plurality of medical companies try to carry out three-dimensional reconstruction on a complex nerve cellulose model, when dense nerve cellulose is rendered, software has higher rendering pressure, and a better display effect is difficult to realize.
Therefore, in the prior art (chinese patent application No. 201510962058.9, disclosing "a three-dimensional reconstruction method of intracranial nerve fiber bundle based on DTI"), a method of three-dimensional reconstruction using mimics software based on MRI data of 3D printing technology and magnetic resonance scanning is not able to guarantee display effect and color display although it can support three-dimensional reconstruction of nerve fiber bundle.
The method reads the OBJ file of the neurocellulose through StreamReader, records the coordinates, colors (RGB) and vertex indexes of all vertexes and forming line segments to obtain the line segment information of one neurocellulose, and then generates a line model by taking the line segments as a reference. (1) And reading the derived model data of the OBJ file to obtain information such as the vertex, the color, the triangular index, the normal line and the like of the model. (2) And drawing the corresponding model according to the read related information.
Patent document CN105295106B (application number: 201510881126.9) discloses a preparation method of a cellulose-based 3D printing wire, belonging to the field of biomass-based 3D printing materials. The purpose is to provide a preparation method of the biomass-based 3D printing material, which has low production cost and is easy to industrialize. The cellulose raw material is combined with polyethylene glycol (PEG; MW 400) and mechanically treated to prepare cellulose polyethylene glycol dispersion liquid with the diameter less than 10 mu m, methylene dichloride is used for washing away the polyethylene glycol to obtain methylene dichloride suspension of cellulose, and a certain amount of silane coupling agent is added for surface silanization modification. Adding the modified cellulose, the plasticizer polyethylene glycol and the toughening agent solution into a dichloromethane solution of polylactic acid with a certain concentration, uniformly mixing, and recovering and removing the dichloromethane solvent through a condensing device. And finally, extruding the mixture by a linear extruding machine at a certain temperature to obtain the cellulose-based 3D printing wire rod.
Disclosure of Invention
In view of the deficiencies in the prior art, it is an object of the present invention to provide a method, system and medium for generating a neurocellulose model based on Unity 3D.
The method for generating the neurocellulose model based on the Unity3D provided by the invention comprises the following steps:
step 1: reading an OBJ file of the neurocellulose according to StreamReader class to obtain the neurocellulose, wherein each neurocellulose comprises a plurality of line segments;
step 2: generating a circular bounding box by taking the line segment as a center to obtain a nerve cellulose model;
and step 3: and reading the color information RGB in the shader loader to obtain the color-gradient neurocellulose model.
Preferably, the step 2 includes:
step 2.1: obtaining a vector N of the line segment according to the starting point and the end point of the line segment, obtaining a vector A vertical to N through cross multiplication of the vector N and a preset vector, obtaining a vector B vertical to the vector N and the vector A through cross multiplication of the vector N and the vector A, and determining a plane by the vector A and the vector B as a plane vertical to the line segment, namely a cross section;
step 2.2: the designated vector A, B is respectively in the x and y coordinate axis directions, six points are uniformly collected on a circle with the starting point P of the current line segment as the center and R as the radius, and the color information of the six points is the color information of the starting point P;
correspondingly collecting six points at the position of the end point, wherein the color information of the six points is the color information of the end point;
connecting the positions of the head end point and the tail end point to generate a bounding box;
step 2.3: taking the section of the terminal point of the first line segment as the section of the starting point of the second line segment; calculating the cross section at the end point, returning to the step 2.1, and continuing to execute until the end of the neurocellulose;
and obtaining a line segment with a cross section of a regular six-surface shape and connected end to end, namely the nerve cellulose model.
Preferably, the method comprises the following steps: the neurocellulose model is segmented in the code.
Preferably, the neurocellulose model is partitioned every 60000 vertices in the code.
The system for generating the neurocellulose model based on the Unity3D provided by the invention comprises the following components:
module M1: reading an OBJ file of the neurocellulose according to StreamReader class to obtain the neurocellulose, wherein each neurocellulose comprises a plurality of line segments;
module M2: generating a circular bounding box by taking the line segment as a center to obtain a nerve cellulose model;
module M3: and reading the color information RGB in the shader loader to obtain the color-gradient neurocellulose model.
Preferably, said module M2 comprises:
module M2.1: obtaining a vector N of the line segment according to the starting point and the end point of the line segment, obtaining a vector A vertical to N through cross multiplication of the vector N and a preset vector, obtaining a vector B vertical to the vector N and the vector A through cross multiplication of the vector N and the vector A, and determining a plane by the vector A and the vector B as a plane vertical to the line segment, namely a cross section;
module M2.2: the designated vector A, B is respectively in the x and y coordinate axis directions, six points are uniformly collected on a circle with the starting point P of the current line segment as the center and R as the radius, and the color information of the six points is the color information of the starting point P;
correspondingly collecting six points at the position of the end point, wherein the color information of the six points is the color information of the end point;
connecting the positions of the head end point and the tail end point to generate a bounding box;
module M2.3: taking the section of the terminal point of the first line segment as the section of the starting point of the second line segment; calculating the section at the end point, returning to the module M2.1, and continuing to execute until the end of the neurocellulose;
and obtaining a line segment with a cross section of a regular six-surface shape and connected end to end, namely the nerve cellulose model.
Preferably, the method comprises the following steps: the neurocellulose model is segmented in the code.
Preferably, the neurocellulose model is partitioned every 60000 vertices in the code.
Compared with the prior art, the invention has the following beneficial effects:
1. the invention can ensure the display effect and color display;
2. the method is simple, and the rendering pressure of software is relieved.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments with reference to the following drawings:
FIG. 1 is a schematic diagram of a cross-section calculated by the present invention to generate bounding boxes.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that it would be obvious to those skilled in the art that various changes and modifications can be made without departing from the spirit of the invention. All falling within the scope of the present invention.
The method for generating the neurocellulose model based on the Unity3D provided by the invention comprises the following steps:
step 1: reading an OBJ file of the neurocellulose through StreamReader classes to obtain segment information of one piece of neurocellulose, wherein each piece of neurocellulose consists of n segments;
step 2: a circular bounding box is generated around the line segment by taking the line segment as a center;
and step 3: in a shader made of a neurocellulose model material, color information (RGB) of a model vertex is directly read, so that a piece of neurocellulose with gradually changed colors is obtained;
and 4, step 4: since unity single mesh has 65000 vertices at most, we split the model every 60000 vertices in code;
the step 2 comprises the following steps:
step 2.1: knowing a starting point and an end point of a line segment to obtain a vector N of the line segment, then cross-multiplying the N with a certain vector to obtain a new vector A vertical to the N, then cross-multiplying the N with the A to obtain a new vector B vertical to the N and the A, and then determining a plane determined by the A and the B as a plane (cross section) vertical to the line segment;
step 2.2: appointing AB to be x and y coordinate axis directions respectively, uniformly collecting six points (as shown in figure 1) on a circle which takes a starting point P of a current line segment as a center and R as a radius, wherein the color information of the six points is equal to that of the starting point P, the end point position is also correspondingly collected with the six points, the color information of the six points is equal to that of the end point, and finally, the positions of the head and the end points are connected to generate a bounding box;
step 2.2: and when the second line segment of the neurocellulose is processed, the terminal point section of the previous line segment is taken as the starting point section of the current line segment. And calculating the cross section at the end point by adopting the same method as the first line segment in sequence until the end of the neurocellulose. Thus, a line segment with a cross section of a regular six-surface shape and connected end to end can be obtained, namely the neurocellulose model. In the shade of the material of the nerve cellulose model, color information (RGB) of model vertexes is directly read, and therefore a strip of nerve cellulose with gradually changed colors is obtained.
Those skilled in the art will appreciate that, in addition to implementing the systems, apparatus, and various modules thereof provided by the present invention in purely computer readable program code, the same procedures can be implemented entirely by logically programming method steps such that the systems, apparatus, and various modules thereof are provided in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Therefore, the system, the device and the modules thereof provided by the present invention can be considered as a hardware component, and the modules included in the system, the device and the modules thereof for implementing various programs can also be considered as structures in the hardware component; modules for performing various functions may also be considered to be both software programs for performing the methods and structures within hardware components.
The foregoing description of specific embodiments of the present invention has been presented. It is to be understood that the present invention is not limited to the specific embodiments described above, and that various changes or modifications may be made by one skilled in the art within the scope of the appended claims without departing from the spirit of the invention. The embodiments and features of the embodiments of the present application may be combined with each other arbitrarily without conflict.

Claims (9)

1. A method for generating a neurocellulose model based on Unity3D, comprising:
step 1: reading an OBJ file of the neurocellulose according to StreamReader class to obtain the neurocellulose, wherein each neurocellulose comprises a plurality of line segments;
step 2: generating a circular bounding box by taking the line segment as a center to obtain a nerve cellulose model;
and step 3: and reading the color information RGB in the shader loader to obtain the color-gradient neurocellulose model.
2. The Unity 3D-based method for generating a neurocellulose model according to claim 1, wherein the step 2 comprises:
step 2.1: obtaining a vector N of the line segment according to the starting point and the end point of the line segment, obtaining a vector A vertical to N through cross multiplication of the vector N and a preset vector, obtaining a vector B vertical to the vector N and the vector A through cross multiplication of the vector N and the vector A, and determining a plane by the vector A and the vector B as a plane vertical to the line segment, namely a cross section;
step 2.2: the designated vector A, B is respectively in the x and y coordinate axis directions, six points are uniformly collected on a circle with the starting point P of the current line segment as the center and R as the radius, and the color information of the six points is the color information of the starting point P;
correspondingly collecting six points at the position of the end point, wherein the color information of the six points is the color information of the end point;
connecting the positions of the head end point and the tail end point to generate a bounding box;
step 2.3: taking the section of the terminal point of the first line segment as the section of the starting point of the second line segment; calculating the cross section at the end point, returning to the step 2.1, and continuing to execute until the end of the neurocellulose;
and obtaining a line segment with a cross section of a regular six-surface shape and connected end to end, namely the nerve cellulose model.
3. The Unity 3D-based method for generating a neurocellulose model according to claim 1, comprising: the neurocellulose model is segmented in the code.
4. The Unity 3D-based method for generating a neurocellulose model according to claim 3, wherein the neurocellulose model is partitioned every 60000 vertices in the code.
5. A system for generating a neurocellulose model based on Unity3D, comprising:
module M1: reading an OBJ file of the neurocellulose according to StreamReader class to obtain the neurocellulose, wherein each neurocellulose comprises a plurality of line segments;
module M2: generating a circular bounding box by taking the line segment as a center to obtain a nerve cellulose model;
module M3: and reading the color information RGB in the shader loader to obtain the color-gradient neurocellulose model.
6. The Unity 3D-based system for generating a neurocellulose model according to claim 1, wherein the module M2 comprises:
module M2.1: obtaining a vector N of the line segment according to the starting point and the end point of the line segment, obtaining a vector A vertical to N through cross multiplication of the vector N and a preset vector, obtaining a vector B vertical to the vector N and the vector A through cross multiplication of the vector N and the vector A, and determining a plane by the vector A and the vector B as a plane vertical to the line segment, namely a cross section;
module M2.2: the designated vector A, B is respectively in the x and y coordinate axis directions, six points are uniformly collected on a circle with the starting point P of the current line segment as the center and R as the radius, and the color information of the six points is the color information of the starting point P;
correspondingly collecting six points at the position of the end point, wherein the color information of the six points is the color information of the end point;
connecting the positions of the head end point and the tail end point to generate a bounding box;
module M2.3: taking the section of the terminal point of the first line segment as the section of the starting point of the second line segment; calculating the section at the end point, returning to the module M2.1, and continuing to execute until the end of the neurocellulose;
and obtaining a line segment with a cross section of a regular six-surface shape and connected end to end, namely the nerve cellulose model.
7. The Unity 3D-based system for generating a neurocellulose model according to claim 1, comprising: the neurocellulose model is segmented in the code.
8. The Unity 3D-based system for generating a neurocellulose model according to claim 3, wherein the neurocellulose model is partitioned every 60000 vertices in code.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 4.
CN202010167548.0A 2020-03-11 2020-03-11 Method, system and medium for generating nerve cellulose model based on Unity3D Active CN111429564B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010167548.0A CN111429564B (en) 2020-03-11 2020-03-11 Method, system and medium for generating nerve cellulose model based on Unity3D

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010167548.0A CN111429564B (en) 2020-03-11 2020-03-11 Method, system and medium for generating nerve cellulose model based on Unity3D

Publications (2)

Publication Number Publication Date
CN111429564A true CN111429564A (en) 2020-07-17
CN111429564B CN111429564B (en) 2023-09-19

Family

ID=71549614

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010167548.0A Active CN111429564B (en) 2020-03-11 2020-03-11 Method, system and medium for generating nerve cellulose model based on Unity3D

Country Status (1)

Country Link
CN (1) CN111429564B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080174311A1 (en) * 2006-11-02 2008-07-24 Siemens Corporation Research, Inc. System and method for fast texture-based tensor field visualization for dt-mri
CN104134232A (en) * 2014-07-11 2014-11-05 浙江工业大学 Space drawing method of cranial nerve fibers and system adopting space drawing method of cranial nerve fibers
US20150164366A1 (en) * 2012-08-09 2015-06-18 Brainlab Ag Localization of fibrous neural structures
CN105488848A (en) * 2014-10-10 2016-04-13 上海联影医疗科技有限公司 Sight line based fiber drawing method
CN105631930A (en) * 2015-11-27 2016-06-01 广州聚普科技有限公司 DTI (Diffusion Tensor Imaging)-based cranial nerve fiber bundle three-dimensional rebuilding method
CN110570508A (en) * 2019-07-23 2019-12-13 博志生物科技(深圳)有限公司 three-dimensional visualization rendering method for osteoporosis condition

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080174311A1 (en) * 2006-11-02 2008-07-24 Siemens Corporation Research, Inc. System and method for fast texture-based tensor field visualization for dt-mri
US20150164366A1 (en) * 2012-08-09 2015-06-18 Brainlab Ag Localization of fibrous neural structures
CN104134232A (en) * 2014-07-11 2014-11-05 浙江工业大学 Space drawing method of cranial nerve fibers and system adopting space drawing method of cranial nerve fibers
CN105488848A (en) * 2014-10-10 2016-04-13 上海联影医疗科技有限公司 Sight line based fiber drawing method
CN105631930A (en) * 2015-11-27 2016-06-01 广州聚普科技有限公司 DTI (Diffusion Tensor Imaging)-based cranial nerve fiber bundle three-dimensional rebuilding method
CN110570508A (en) * 2019-07-23 2019-12-13 博志生物科技(深圳)有限公司 three-dimensional visualization rendering method for osteoporosis condition

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘义鹏;徐超清;蒋哲臣;蒋莉;冯远静;梁荣华;: "脑纤维可视化综述", 计算机辅助设计与图形学学报 *
吴辉群;耿兴云;蒋葵;吕广明;韩笑;季达峰;董建成;: "正常成年小鼠脊髓内部结构的三维重建", 中国数字医学 *

Also Published As

Publication number Publication date
CN111429564B (en) 2023-09-19

Similar Documents

Publication Publication Date Title
US8253730B1 (en) System and method for construction of data structures for ray tracing using bounding hierarchies
CN110442925B (en) Three-dimensional visualization method and system based on real-time dynamic segmentation reconstruction
CN107562980B (en) Geometric information extraction method based on BIM model
CN103679627A (en) Tile based computer graphics
KR100503789B1 (en) A rendering system, rendering method, and recording medium therefor
CN108537891A (en) The method that three-dimensional material and textures data are automatically switched to UE4
CN113593030A (en) Geological profile generation method, system, terminal and medium based on three-dimensional model
CN109190326A (en) Generate the method and device of process flow chart
US8587586B2 (en) Electronic device and method for meshing curved surface
US9007370B2 (en) Computing device and method for processing curved surface
KR101810019B1 (en) Animation data generating method, apparatus, and electronic device
CN109858059B (en) Application method of virtual reality technology based on CAD (computer-aided design) super-large model in hydropower station simulation
US8339401B2 (en) Curved surface importing device and method
CN113656883B (en) Tire finite element simulation analysis data post-processing method
CN111429564A (en) Method, system and medium for generating a neurocellulose model based on Unity3D
CN116127802B (en) Method, device and system for displaying CAE simulation result on 3D (three-dimensional) view
CN110751732B (en) Method for converting 2D image into 3D image
CN107590298A (en) Voxelization method and information processor
Barr et al. Automated production of contour maps for electrophysiology II. Triangulation, verification, and organization of the geometric model
US5883629A (en) Recursive and anisotropic method and article of manufacture for generating a balanced computer representation of an object
CN103065306A (en) Processing method and device of graphic data
CN111179420B (en) Three-dimensional city model optimization method and system
CN116109767A (en) Rendering method of three-dimensional scene, image processor, electronic device and storage medium
CN112348935B (en) Wire frame rendering method, terminal device and computer-readable storage medium
CN103020356B (en) A kind of triangulation of non-close figure

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant