Question

In: Computer Science

1.1 Describe the Marching Cubes algorithm using pseudo-code. What are potential issues of Marching Cubes. (I...

1.1 Describe the Marching Cubes algorithm using pseudo-code. What are potential issues of Marching Cubes.
(I need pseudo code explaination)

Solutions

Expert Solution

solution:

given data:

1.1): Marching Cubes algorithm using pseudo-code:

The pseudocode below describes an application of Marching Cubes for representing the volumetric union, intersection, or difference of two closed triangular meshes.

For clarity, one simple optimization was left out of the ISINSIDE() subroutine: The triangles of the surface A can be persistently associated with cubes on a uniform grid, and raytesting can first identify the grid cubes that intersect the ray before testing the triangles associated with each cube. This eliminates the need to test many triangles.

ALGORITHM: Marching Cubes

Input: Closed surface A

Input: Closed surface B

Input: CSG_OP, one of {UNION, INTERSECTION,DIFFERENCE}

Input: Resolution r

let L be an axis-aligned lattice of cubes with sidelength r

let T be an empty list of triangles

for each lattice point p in L do

let pA = ISINSIDE(A, p, r)

let pB = ISINSIDE(B, p, r)

let pOUT = CSG_STATE(CSG_OP, pA, pB)

end for

for each lattice segment e in L do

let points p1 and p2 be endpoints of e

if (p1OUT ≠ p2OUT then)

set edge point p0 = INT_POINT(CSG_OP, A, B, p1, p2)

end if

end for

for each cube c in L do

let P = {p0, p1, . . . , p7} be corners of c

let E = {e0, e1, . . . , } be edge points of any segment of c

let triangles t = LOOKUP(P, E)

append t to T

end for

Output: T, the output boundary surface

ISINSIDE(A, p, r)

Input: Closed surface A

Input: point p

let R be a randomly oriented ray originating at p

let L be an axis-aligned lattice of cubes with sidelength r

let pointList be an empty list of points

for each triangle t in A that intersects R do

let pi be the point of intersection between t and R

if pi is not already an element of pointList then

add pi to pointList

end if

end for

if the size of pointList is even then

Output: false, p is outside A

else

Output: true, p is inside A

end if

CSG_STATE(CSG_OP, pA, pB)

Input: CSG_OP, one of {UNION, INTERSECTION,DIFFERENCE}

Input: pA, true if p is inside surface A, false otherwise.

Input: pB, true if p is inside surface B, false otherwise.

let the bool result = false

if CSG_OP = UNION and pA = true or pB = true then

set result = true

end if

if CSG_OP = INTERSECTION and pA = true and pB = true then

set result = true

end if

if CSG_OP = DIFFERENCE and pA = true and pB = false then

set result = true

end if

Output: result

INT_POINT(CSG_OP, A, B, p1, p2)

Input: CSG_OP, one of {UNION, INTERSECTION,DIFFERENCE}

Input: the surfaces A, B

Input: p1, p2, endpoints of the lattice segment e.

Either p1 is p2 is inside the output surface.

Assume without loss of generality that p1 is inside the output surface.

let pa be the point where e intersects A

let pb be the point where e intersects B

if either pa or pb does not exist then

Output: pb or pa, the one that does exist.

else

if CSG_OP = UNION then

Output: pa or pb, whichever is further from p1.

end if

if CSG_OP = INTERSECTION or DIFFERENCE then

Output: pa or pb, whichever is closer to p1.

end if

LOOKUP(P, E)

Input: P, the inside/outside state of the 8 lattice cube corners.

Input: E, intersection points on lattice segments of the cube.

Output: Triangles t that approximate the output surface in the cube.

Potential issues of Marching Cubes:

1. Creates mesh which can be highly over-sampled (requires Decimation) and contain bad triangle shapes (requires Mesh Optimization / Re-Meshing).

2. Linear interpolation of distance values approximates smooth surfaces: Sharp features within cells are lost.

3. Aliasing artifacts due to alignment of the voxel grid. Increasing voxel resolution only reduces the size of the artifacts but they never go away.

please give me thumb up


Related Solutions

Develop an algorithm for INSERTION SORT. Give the pseudo-code version. Convert your pseudo-code into a Java...
Develop an algorithm for INSERTION SORT. Give the pseudo-code version. Convert your pseudo-code into a Java program.
In pseudo-code, design an algorithm for finding baking a cake.
In pseudo-code, design an algorithm for finding baking a cake.
Describe in pseudo-code, a linear-time algorithm for reversing a queue Q. To access the queue, you...
Describe in pseudo-code, a linear-time algorithm for reversing a queue Q. To access the queue, you are only allowed to use the basic functions of the queue ADT defined as follows (Hint: Using a stack, the basic stack functions defined in the textbook and in the class). class Queue { public: int size(); bool isEmpty(); Object front(); void enqueue(Object o); Object dequeue(); };
Write a pseudo code for an O (n7log3n) algorithm. Please write in C++.
Write a pseudo code for an O (n7log3n) algorithm. Please write in C++.
Write an algorithm in pseudo code to find one element and delete it in a doubly...
Write an algorithm in pseudo code to find one element and delete it in a doubly linked list. Your algorithm will print the original list, request the user to put in an element to be deleted, then print the final list after the deletion is done. If the element doesn’t exist in the list, print "XXX is not in the list" where "XXX" should be the one you received from the user. Use the following as your test cases to...
Write a recursive algorithm in pseudo-code to compute the “power list” of a given list of...
Write a recursive algorithm in pseudo-code to compute the “power list” of a given list of integers. Assume that the List type has members: int List.length returns the length of the list. void List.push(T n) pushes an element n to the front of the list T List.pop() pops an element from the front of the list. List$$ List$$.concat(List$$ other) returns the concatenation of this list with other. Explain in plain English the reasoning behind your algorithm. Power Lists should be...
I need to make pseudo code for hybrid priority queue using both minheap and maxheap by...
I need to make pseudo code for hybrid priority queue using both minheap and maxheap by ARRAY. i need to have a function that extends the size of array once it meets certain condition. Also, I need to implement function remove, insert(k,v), top, toggle, switchtoMin, switchtoMax, state, isEmpty, and size. Please guide me the pseudo code with above conditions
*Please give the answers in pseudo code 1) Design an algorithm that will receive two integer...
*Please give the answers in pseudo code 1) Design an algorithm that will receive two integer items from a terminal operator, and display to the screen their sum, difference, product and quotient. Note that the quotient calculation (first integer divided by second integer) is only to be performed if the second integer does not equal zero. 2) Design an algorithm that will read two numbers and an integer code from the screen. The value of the integer code should be...
1. Write an algorithm to calculate the Matrix multiplication (or write with pseudo code) 2. Write...
1. Write an algorithm to calculate the Matrix multiplication (or write with pseudo code) 2. Write an algorithm to calculate the recursive Matrix multiplication (or write with pseudo code) 3. Find the time complexity of your pseudo code and analyze the differences
Write the pseudo code for longest common subsequence algorithm in Java. Alg lCS( X , n,...
Write the pseudo code for longest common subsequence algorithm in Java. Alg lCS( X , n, Y, m) Input: String X of length n, String Y of length m Output: return the length of the longest common subsequence between X and Y
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT