In craniomaxillofacial (CMF) surgery, a critical step is to reestablish dental occlusion. Digitally establishing new dental occlusion is extremely difficult. It is especially true when the maxilla is segmentalized into 3 pieces, a common procedure in CMF surgery. In this paper, we present a novel midlineguided occlusal optimization (MGO) approach to automatically and efficiently reestablish dental occlusion for 3-piece maxillary surgery. Our MGO approach consists of 2 main steps. The anterior segment of the maxilla is first aligned to the intact mandible using our ergodic midline-match algorithm. The right and left posterior segments are then aligned to the mandible in sequence using an improved iterative surface-based minimum distance mapping algorithm. Our method has been validated using 15 sets of digital dental models. The results showed our algorithm-generated 3-piece articulation is more efficient and effective than the current standard of care method. The results demonstrated our approach’s significant clinical impact and technical contributions.